Explain any five string methods?
Answer / Anupam Kumar Gautam
1. length(): Returns the length of a string.n2. substring(start, end): Extracts a part of the string from the specified index range.n3. toUpperCase()/toLowercase(): Converts the entire string to upper or lower case respectively.n4. trim(): Removes leading and trailing whitespaces from a string.n5. replace(oldChar, newChar): Replaces all occurrences of an old character with a new one.
| Is This Answer Correct ? | 0 Yes | 0 No |
What are the advantages of case class?
What is the usage of isInstanceOf and asInstanceOf methods in Scala? Is there anything similar concept available in Java?
Tell me some features which are supported by Java, but not by Scala and Vice versa?
How scala is different from java?
What is list in scala collection?
In what ways Scala is better than other programming language?
List types of identifiers available in scala?
What is the main design decision about two separate keywords: class and object in Scala? How do we define Instance members and Static members in Scala?
Difference between Scala’s Int and Java’s java.lang.Integer? What is the relationship between Int and RichInt in Scala?
In FP, What is the difference between a function and a procedure?
What is a custom exception in scala?
Like Java, what are the default imports in Scala Language?