Search w3schools.com:

SHARE THIS PAGE

VBScript RTrim Function


VBScript Reference Complete VBScript Reference

The RTrim function removes spaces on the right side of a string.

Tip: Also look at the LTrim and the Trim functions.

Syntax

RTrim(string)

Parameter Description
string Required. A string expression

Example

Example

<script type="text/vbscript">

fname=" Jack "
document.write("Hello" & RTrim(fname) & "and welcome.")

</script>

The output of the code above will be:

Hello Jackand welcome.

Try it yourself »

VBScript Reference Complete VBScript Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]