Java program to perform the string operations
KW.java
Output
kodingwindow@kw:~$ javac KW.java
kodingwindow@kw:~$ java KW ——————————————————————————————————————————— Program to perform the string operations ——————————————————————————————————————————— Main string | Hello World ——————————————————————————————————————————— Length of string | 11 Lowercase of string | hello world Uppercase of string | HELLO WORLD Char at 6th position | W Index position of W | 6 Matching substring ld | true Is string start with A| false Replace space by * | Hello*World From 3rd position | lo World Dispaly from e to r | ello Wor Hash code for string | -862545276 ——————————————————————————————————————————— kodingwindow@kw:~$
What Next?
Java implementation of the contentEquals method
Java implementation of the equals method
Java implementation of the compareTo and equals methods
Advertisement