How to remove word from the beginning of a string in Groovy

2 Answers

0 votes
String s = "Groovy Java PHP"

s = s.minus("Groovy "); 

println(s)




/*
run:

Java PHP

*/

 



answered Sep 30, 2020 by avibootz
0 votes
def r = 'Java '  

String s = 'Java Groovy Python' - r

println(s)




/*
run:

Groovy Python

*/

 



answered Sep 30, 2020 by avibootz

Related questions

1 answer 223 views
1 answer 453 views
1 answer 221 views
1 answer 361 views
1 answer 367 views
1 answer 381 views
1 answer 524 views
...