I have a problem to get last two digit from a string.
example :
String texter = "5793231309"
how to get '09' ? so when Iprintln "texter : "+texter
. It will be Groovy<<09
I try split but it not successful ?
Use this to split your first String:
static main(args) {
String texter = "5793231309"
String texter2 = texter[-2..-1]
println(texter2)
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments