Get the last three chars from any string - Java

前端 未结 11 1472
情话喂你
情话喂你 2020-12-24 10:21

I\'m trying to take the last three chracters of any string and save it as another String variable. I\'m having some tough time with my thought process.

Strin         


        
11条回答
  •  南方客
    南方客 (楼主)
    2020-12-24 11:04

    This method would be helpful :

    String rightPart(String text,int length)
    {
        if (text.length()

提交回复
热议问题