How to remove the first word from a string in Java

1 Answer

0 votes
public class MyClass {
    public static void main(String args[]) {
        String s = "java c c++ python c#";
 
        s = s.substring(s.indexOf(' ') + 1);
 
        System.out.println(s);
    }
}
   
   
   
/*
run:
   
c c++ python c#
 
*/

 



answered Oct 30, 2020 by avibootz

Related questions

1 answer 129 views
1 answer 169 views
2 answers 207 views
2 answers 199 views
3 answers 292 views
1 answer 136 views
...