Skip to content

Tag Archives: Scala-Strings

In Scala, as in Java, a string is a sequence of characters. In Scala, objects of String are immutable which means a constant and cannot… Read More
The substring(int beginIndex, int endIndex) method is utilized to find the sub-string from the stated String which starts and ends with the index specified. Method… Read More
The startsWith(String prefix, int toffset) method is utilized to check if the stated string starts with the prefix or not that is being specified by… Read More
The split(String regex, int limit) method is same as split(String, regex) method but the only difference here is that you can limit the number of… Read More
The startsWith(String prefix) method is utilized to check if the stated string starts with the prefix or not that is being specified by us. Method… Read More
The trim() method is utilized to omit the leading and trailing spaces in the stated string. Method Definition: String trim() Return Type: It returns the… Read More
The toUpperCase() method is utilized to convert all the characters of the stated string to uppercase. Method Definition: String toUpperCase() Return Type: It returns the… Read More
The toString() method is utilized to return a string object itself. Method Definition: String toString() Return Type: It returns the string object. Example: 1# //… Read More
The toLowerCase() method is utilized to convert all the characters in the String into the lowercase. Method Definition: String toLowerCase() Return Type: It returns the… Read More
The toCharArray() method is utilized to convert a stated string to CharArray. Method Definition: char[] toCharArray() Return Type: It returns CharArray. Example: 1# // Scala… Read More
The substring() method is utilized to find the sub-string from the stated String which starts from the index specified. Method Definition: String substring(int beginIndex) Return… Read More
The subSequence() method is utilized to find the sub-sequence from the given String, And this sub-sequence starts and ends with the index we specify. Method… Read More
The lastIndexOf(String str) method is utilized to return the index of the last appearance of the sub-string we specify in the argument from the stated… Read More
The replaceFirst() method is same as replaceAll but here only the first appearance of the stated sub-string will be replaced. Method Definition: String replaceFirst(String regex,… Read More
The replaceAll() method is used to replace each of the stated sub-string of the string which matches the regular expression with the string we supply… Read More