README.md

December 4, 2022 ยท View on GitHub

Trim, LTrim & RTrim in Javascript

Description

These functions have the same functionality as the homonymous ones in VBScript, they remove leading and/or trailing spaces from a given string

More Info

Any String

The string inputed less leading and/or trailing spaces

Submitted On
ByWalter Staeblein
LevelBeginner
User Rating4.3 (17 globes from 4 users)
Compatibility
CategoryString Manipulation
WorldJava
Archive File

Source Code

<script language="javascript">
function jsTrim(TXT)
{
	return TXT.replace(/(^\s+)|(\s+$)/g,"");
}
function jsLTrim(TXT)
{
	return TXT.replace(/(^\s+)/g,"");
}
function jsRTrim(TXT)
{
	return TXT.replace(/(\s+$)/g,"");
}
</script>