This code defines a string variable with leading and trailing whitespace, prints it to the console, then prints it again after using the Trim method to remove all leading and trailing whitespace, demonstrating that Trim removes whitespace from the beginning and end of a string.
2. The effect of Trim
Dim iHaveLoadsOfWhiteSpace As String
iHaveLoadsOfWhiteSpace = " GET A LOAD OF MY WHITE SPACE
"
Console.WriteLine(iHaveLoadsOfWhiteSpace)
Console.WriteLine(iHaveLoadsOfWhiteSpace.Trim)
All the leading and trailing
white space is removed