Description: JavaScript doesn t have a built-in Trim function, which trims white spaces from the beginning and the end of a string. In this article I ll show you how to create 3 very useful trim JavaScript functions leftTrim(), rightTrim(), and allTrim(). Lets start with leftTrim() function, which will trim all white spaces in front of a string and will return the trimmed string. Please have a look at the leftTrim JavaScript function below: function leftTrim(sString) { while (sString.substring(0,1)...