What are the string handling functions in Java

1 Answer

0 votes
public class MyClass {
    public static void main(String args[]) {
        String s1 = "java python";
        String s2 = "c++ c c#";

        System.out.println(s1.equals(s2));
        System.out.println(s1.charAt(2));
        System.out.println(s1.concat(" php"));
        System.out.println(s1.length());
        System.out.println(s1.toLowerCase());
        System.out.println(s1.toUpperCase());
        System.out.println(s1.indexOf('a'));
        System.out.println(s1.substring(0, 6));
        System.out.println(s1.substring(7));  
    }
}




/*
run:

false
v
java python php
11
java python
JAVA PYTHON
1
java p
thon

*/

 



answered Jun 8, 2023 by avibootz

Related questions

1 answer 277 views
1 answer 315 views
1 answer 286 views
1 answer 234 views
1 answer 288 views
288 views asked Dec 16, 2016 by avibootz
...