Followingis the pictorial representation of using the string Trim() method to remove all leading and trailing whitespaces from the defined string in a visual basic programming language.
Following is the syntax of defining a string Trim method to remove all leading and trailing whitespaces or specified characters from the string object in a visual basic programming language.
Following is the example of using a string Trim() method to remove the starting and end of whitespaces or specified characters from the string object in a visual basic programming language.
If you observe the above example, we used a string Trim() method with or without characters to remove all leading and trailing whitespaces and the defined characters from the string object.
The Trim() method will remove all leading and trailing whitespaces or defined characters from the current string object in visual basic. If you want to remove only leading or starting occurrences of the whitespaces or characters from the string, you need to use TrimStart() method.
3a8082e126