I have a requirement like to find out only the last character of a string.
e.g the string is "The bit position of the given number is 5". Then the code should return me the last character as "5"
var str = "The bit position of the given number is 5";
alert("Last char of the string : "+str.slice(-1) );