Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ParameterDescription
StringThe string to be trimmed. (REQUIRED)
FlagsFlags that control how the string is to be trimmed. (OPTIONAL)
TrimCharsThe characters to be trimmed in addition to standard whitespace characters(OPTIONAL)

Remarks

The SRP_Trim method does everything the OI Trim method does (and by extension, the TrimF and TrimB functions), but gives you more control.

...

FlagNameDescription
FTrim FrontIf present, this flag indicates that leading trim characters should be removed completely
BTrim BackIf present, this flag indicates that trailing trim characters should be removed completely
MTrim MiddleIf present, this flag indicates that sequences of trim characters found within the string should be condensed
QTrim QuotesIf present, this flag indicates that string within quotes should be trimmed
AAdditional Absolute Trim CharsIf present, this flag indicates that any characters in the TrimChars parameter should be be instead of whitespace trim characters. If you omit this flag, the characters in TrimChars are added to the default whitespace trim standard white space characters.

To set the flags parameter, just include the characters you want into a string. If you only want to trim the front, then you pass "F". If you want to trim the front and back, including quotes, then you would pass "FBQ". If you omit this parameter or leave it blank, then the default is "FMBQ", which results in the same functionality as OI's Trim function.

...