Courses
Tutorials
Practice
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
38.9K+ articles
DSA
22.5K+ articles
Python
20.5K+ articles
Experiences
16.6K+ articles
Interview Experiences
14.1K+ articles
JavaScript
11.7K+ articles
Scala
1.8K+ articles
Scala-Method
1.3K+ articles
Scala
1.2K+ articles
Scala-Basics
36+ articles
Scala-Strings
41 posts
Recent Articles
Popular Articles
Scala - String Methods with Examples
Last Updated: 26 May 2022
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 be changed once created. In the res...
read more
Scala-Strings
Scala
Scala String substring(int beginIndex, int endIndex) method with example
Last Updated: 29 October 2019
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 Definiti...
read more
Scala
Scala-Method
Scala-Strings
Scala
Scala String startsWith(String prefix, int toffset) method with example
Last Updated: 29 October 2019
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 us at the specified in...
read more
Scala
Scala-Method
Scala-Strings
Scala
Scala String split(String regex, int limit) method with example
Last Updated: 29 October 2019
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 elements in the resultant...
read more
Scala
Scala-Method
Scala-Strings
Scala
Scala String startsWith(String prefix) method with example
Last Updated: 29 October 2019
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 Definition: Boolean start...
read more
Scala
Scala-Method
Scala-Strings
Scala
Scala String trim() method with example
Last Updated: 29 October 2019
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 stated string after ...
read more
Scala
Scala-Method
Scala-Strings
Scala
Scala String toUpperCase() method with example
Last Updated: 29 October 2019
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 res...
read more
Scala
Scala-Method
Scala-Strings
Scala
Scala String toString() method with example
Last Updated: 29 October 2019
The toString() method is utilized to return a string object itself.Method Definition: String toString()Return Type: It returns the string object.Example: 1# [sourcecode la...
read more
Scala
Scala-Method
Scala-Strings
Scala
Scala String toLowerCase() method with example
Last Updated: 29 October 2019
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 resu...
read more
Scala
Scala-Method
Scala-Strings
Scala
Scala String toCharArray() method with example
Last Updated: 29 October 2019
The toCharArray() method is utilized to convert a stated string to CharArray.Method Definition: char[] toCharArray()Return Type: It returns CharArray.Example: 1# [sourceco...
read more
Scala
Scala-Method
Scala-Strings
Scala
Scala String substring() method with example
Last Updated: 23 October 2019
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)R...
read more
Scala
Scala-Method
Scala-Strings
Scala
Scala String subSequence() method with example
Last Updated: 23 October 2019
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 Definition: Cha...
read more
Scala
Scala-Method
Scala-Strings
Scala
Scala String lastIndexOf(String str) method with example
Last Updated: 03 October 2019
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 string.Method Defini...
read more
Scala
Scala-Method
Scala-Strings
Scala
Scala String replaceFirst() method with example
Last Updated: 03 October 2019
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 ...
read more
Scala
Scala-Method
Scala-Strings
Scala
Scala String replaceAll() method with example
Last Updated: 03 October 2019
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 in the argument list....
read more
Scala
Scala-Method
Scala-Strings
Scala
1
2
3
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !