What is the PHP strrpos() equivalent in Java

1 Answer

0 votes
public class MyClass {
    public static void main(String args[]) {
        String str = "c# c java c++ python go";
        
        int pos = str.lastIndexOf(' '); // strrpos()

        System.out.println(pos);
    }
}
 
 
 
 
/*
run: 
    
20
    
*/

 



answered Aug 9, 2023 by avibootz

Related questions

1 answer 142 views
142 views asked Aug 9, 2023 by avibootz
1 answer 147 views
1 answer 296 views
1 answer 238 views
1 answer 155 views
1 answer 156 views
1 answer 219 views
219 views asked Aug 7, 2021 by avibootz
...