how can you find a substring in a string. Explain with the help of example?
Answers
Answered by
1
Answer:
This can be done by running a nested loop traversing
public static void main(String[] args) {
String s1="Javatpoint";
String substr = s1.substring(0); // Starts with 0 and goes to end.
System.out.println(substr);
String substr2 = s1.substring(5,10); //
Starts from 5 and goes to 10.
hope this helps you please mark me as brainliest
Similar questions