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

1 Answer

0 votes
String s = "Groovy Java Python"

println(s.endsWith("n"));
println(s.endsWith("p"));



 
/*
run:
 
true
false
 
*/

 



answered Oct 1, 2020 by avibootz

Related questions

1 answer 166 views
1 answer 360 views
1 answer 195 views
1 answer 219 views
1 answer 223 views
1 answer 233 views
...