Removing Ending Whitespaces from a String (Right Trim), using Javascript
Use the code below:
// Pass the string as argument (value) to the function below.
function RightTrim( value )
{
var re = /((s*S+)*)s*/;
return value.replace(re, "$1");
}
Please feel free to use the comments form below if you have any questions or need more explanation on anything. Use the icons below to share this tutorial with your friends.
tags cloud
popular searches
free download for mysql database server 5.1.5, php, linux, mysql mysql, mysql, java, install mysql, gearman, ubuntu, tools, source code, bison, mysql initialization, install cairo, laptop
Similar Tutorials:
- Go to Top of the Page Using Javascript
- How to execute a function at regular intervals using Javascript
- Sleep/Pause for specified number of seconds
- Trim whitespaces from both ends of a string, using Javascript
- Javascript: Encoding Values in XML Strings for AJAX / Web 2.0
Tutorials in 'Web Development > Javascript' (more):
- How to find if argument is numeric or not, using Javascript
- Sleep/Pause for specified number of seconds
- Javascript: Encoding Values in XML Strings for AJAX / Web 2.0
- Removing Whitespaces from Beginning of a String (Left Trim), using Javascript
- How to execute a function at regular intervals using Javascript


Comments (write a comment):
0 comments so far. Be the first one to leave a comment on this article.