/ Published in: ActionScript 3
Returns the last character is a string.
Expand |
Embed | Plain Text
function getLastCharInString($s:String):String { return $s.substr($s.length-1,$s.length); } trace(getLastCharInString("abcdefg")); // OUTPUT // g
Comments
Subscribe to comments
You need to login to post a comment.

I preffer using myString.slice(-1);