VBScript RTrim Function

## VBScript Tutorial

VB HOME VB How to VB Variables VB Procedures VB Conditional VB Looping VB Summary

## VB Examples

VB Examples

## VB References

VB Functions VB Keywords

# VBScript RTrim Function

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

<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 »

Complete VBScript Reference

## Your suggestion:

Your E-mail (optional):

Page address:

Description:

Close [X]

## Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

## WEB HOSTING

Best Web Hosting UK Reseller Hosting Wow! $5 SSD Hosting

## WEB BUILDING

Download XML Editor
FREE Website BUILDER FREE Website Creator

## WEB RESOURCES

Web Statistics Web Validation

## SHARE THIS PAGE