Get a substring of specific size from starting of a string in Julia - first() Method Last Updated : 26 Mar, 2020 Comments Improve Suggest changes Like Article Like Report The first() is an inbuilt function in julia which is used to return a string consisting of the first n characters of the specified string, where n will be passed as parameter. Syntax: first(s::AbstractString, n::Integer) Parameters: s::AbstractString: Specified string. n::Integer: Specified integer value. Returns: It returns a string consisting of the first n characters of the specified string, where n will be passed as parameter. Example 1: Python # Julia program to illustrate # the use of String first() method # Getting a string consisting of the first # n characters of the specified string println(first("GeeksforGeeks", 0)) println(first("GeeksforGeeks", 5)) println(first("GeeksforGeeks", 8)) println(first("GeeksforGeeks", 10)) Output: Example 2: Python # Julia program to illustrate # the use of String first() method # Getting a string consisting of the first # n characters of the specified string println(first("1 + 2+3 + 4", 0)) println(first("2-4-6-8", 4)) println(first("1 * 3*5 * 7", 6)) Output: Comment More infoAdvertise with us Next Article Get a substring of specific size from starting of a string in Julia - first() Method K Kanchan_Ray Follow Improve Article Tags : Julia Similar Reads Get a substring of specific size from end of a string in Julia - last() Method The last() is an inbuilt function in julia which is used to return a string consisting of the last n characters of the specified string, where n will be passed as parameter. Syntax: last(s::AbstractString, n::Integer) Parameters: s::AbstractString: Specified string. n::Integer: Specified integer val 1 min read Get a substring of specified length from a string in Julia - SubString() Method The SubString() is an inbuilt function in julia which is used to return a part of the specified parent string s within range i:j or r, where i, j and r is given as the parameter. Syntax: SubString(string::AbstractString, i::Integer, j::Integer) or SubString(string::AbstractString, r::UnitRange) Para 2 min read Splitting string into array of substrings in Julia - split() and rsplit() Method The split() is an inbuilt function in julia which is used to split a specified string into an array of substrings on occurrences of the specified delimiter(s). Syntax: split(str::AbstractString, dlm; limit::Integer, keepempty::Bool) or split(str::AbstractString; limit::Integer, keepempty::Bool) Para 2 min read Get the first occurrence of the specified string pattern in Julia - findfirst() Method The findfirst() is an inbuilt function in julia that is used to return the first occurrence of the specified pattern in a specified string. Syntax: findfirst(Pattern::AbstractString, String::AbstractString) Parameters: Pattern: Specified pattern to be searchedString: Specified string Returns: It 1 min read Check if string starts with a specified prefix in Julia - startswith() Method The startswith() is an inbuilt function in julia which is used to return true if the specified string start with the specified prefix else return false. Syntax: startswith(s::AbstractString, prefix::AbstractString) Parameters: s::AbstractString: Specified string. prefix::AbstractString: Specified pr 1 min read Like