Find and remove last character in a string

by Nithya 2012-05-21 12:21:46

allnum="abc,test,good,best,";

lastchar = allnum.charAt(allnum.length - 1 ); //finds last character in the string(allnum)

allnum = allnum.substring(0, allnum.length-1); //removes the last character

Tagged in:

611
like
0
dislike
0
mail
flag

You must LOGIN to add comments