www.icetips.com  Icetips Utilities Documentation 7/6/2014    

String Class:  DepunctuateString

Previous  Top  Next  


Prototype: (*String pS, Byte pAllowDigits=False)

 

pSString to depunctuate.
pAllowDigitsIndicates that numeric digits are allowed in the string.

 

ReturnspS without any punctuation characters.

 

This method can be used to remove all punctuation from a string.  This includes all control characters with ASCII value less than 32.  The method uses the IsPunct function to determine if the character is punctuation or not.  If pAllowsDigits is true, the the method also uses IsDigit to determine if the character is a digit or not.  Note that this does not remove spaces.  For that use the CompactString method.

 

Note:  On September 18, 2009 we added ()[]{{}!@#$%^&*- as punctuation characters that are replaced with a space in this method.  Note that this is in addition to the original usage of IsPunct etc. You can use the SetDepunctuationString method to change this.

 

Example:

 

ITS  ITStringClass

S1   String(100)

Code

S1 = 'Icetips Creative, Inc.'

ITS.DepunctuateString(S1)

! S1 would now be 'Icetips Creative Inc'

 

 

See also:

CompactString

SetDepunctuationString



Direct link to this page: http://www.icetips.com/manuals/utilities/depunctuatestring_stringclass.htm