Quick actions

cmd+k|ctrl+k

Navigation

Languages

reverse

Snippet info

Language

Groovy

Visibility

public

Author

orochi-100

Created

2021-10-11T11:20:36.574746Z

Updated

2021-10-11T11:20:57.760616Z

void reverse(str)
{
    def rstr = ''
    def j = 0

    (str.length()..<0).each {
        rstr += str[it - 1]
    }
    println rstr
}
    
reverse("KING")
println 'KING'.reverse()
INFO