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 235 views
235 views asked Aug 9, 2023 by avibootz
1 answer 228 views
1 answer 391 views
1 answer 315 views
1 answer 246 views
1 answer 237 views
1 answer 295 views
295 views asked Aug 7, 2021 by avibootz
...