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 168 views
1 answer 365 views
1 answer 209 views
1 answer 229 views
1 answer 233 views
1 answer 242 views
...