Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Trim, TrimB, TrimF functions ====== ==== Description ==== Deletes extra blank spaces from a character string or variable. ==== Syntax ==== //blankless// = **Trim**(//expression//) //blankless// = **TrimB**(//expression//) //blankless// = **TrimF**(//expression//) ==== Parameters ==== The Trim functions accept arguments for the following parameter. ^Parameter^Description^ |//Expression//|Any legal BASIC+ expression.| Multiple consecutive spaces can be deleted from a character string or variable by using the Trim function. The unneeded blanks preceding the first valid character string and those extra blanks following the last valid characters are deleted along with any extra blanks separating valid words. ==== See Also ==== The [[etmethod|ETMethod()]] function removes the empty rows from an edit table or DataSet. ==== Examples ==== In the following examples, %%^%% indicates a blank space. Example 1 <code> T = "^^^^^EXTRA^^^BLANKS^^TAKE^^^UP^^Space^^^" T = Trim(T) </code> The extra blanks will be trimmed and the variable identifier T is as: <code> EXTRA^BLANKS^TAKE^UP^Space </code> The TrimB function deletes blank spaces at the end of a character string. Using the same example as above, TrimB(T) would generate: <code> ^^^^EXTRA^^^BLANKS^^TAKE^^^UP^^Space </code> The TrimF function deletes spaces from the front of a character string. Using the same example as above, TrimF(T) would generate: <code> EXTRA^^^BLANKS^^TAKE^^^UP^^Space^^^ </code> Example 2 <code> string = "Dear^Mr.^Leu^^^:" string = Trim(string) * string is "Dear Mr. Leu:" first = "^^ROBERT^^^" middle = "E." last = "LEWIS^^^^" NAME = Trim(first:middle:last) * The name is trimmed to the string value "ROBERT^E.^LEWIS" X = "^^^1^^^2^^3^4^^^" output =TrimF(X) *output is 1^^^2^^3^4^^^ </code> guides/programming/programmers_reference_manual/trim.txt Last modified: 2024/06/19 20:20by 127.0.0.1