How to check if a string ends with specific substring in Groovy

1 Answer

0 votes
String s = "Groovy Java Python"

println(s.endsWith("Python"));
println(s.endsWith("hon"));
println(s.endsWith("PHP"));



 
/*
run:
 
true
true
false
 
*/

 



answered Oct 1, 2020 by avibootz

Related questions

1 answer 339 views
1 answer 448 views
1 answer 311 views
1 answer 380 views
1 answer 275 views
1 answer 339 views
...