compressString

Syntax: compressString(inputString, stringForCompress)

Arguments:

  • inputString is the original string to be edited.
  • stringForCompress is the string of characters to be removed.

Return Type: String

Description: This function returns a string with each of the specified characters removed. For example, if you specify "abc," all instances of "a", "b," and "c" are removed. Use this function to remove all instances of a specific character from a string of characters. This is especially useful for removing characters from names.

If there are repeating characters in a string, all of them are compressed.

Example:
if compressString("Johnny Wilkerson", "ny") 
then ...
In this example, the characters "n" and "y" are removed from the name Johnny Wilkerson to make Joh Wilkerso.

In the following example, "eef" is compressed instead of just "ef."

SRVC_UDVString1 = compressString("abcdeefghijklmn", "ef");

In this case, SRVC_UDVString1 = abcdghijklmn.

  • www.fico.com