Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript right trim

function rtrim(str, ch)
{
    for (i = str.length - 1; i >= 0; i--)
    {
        if (ch != str.charAt(i))
        {
            str = str.substring(0, i + 1);
            break;
        }
    } 
    return str;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #trim
ADD COMMENT
Topic
Name
4+4 =