` Printed Icetips Article

Icetips Article



Par2: Strip characters out of a string
2001-11-05 -- Dennis Evans
 
> How do I best take a string a strip hyphens and commas, etc... out?

   you folks work too hard, use strtok,

   for a string like
   'This is - a t-est of - the -- hy-phens --- remo-val'

   call,

  Delimit = '-'
  WorkStr = 'This is - a t-est of - the -- hy-phens --- remo-ve'
   StripString(WorkStr, ResultStr, Delimit)

   ResultStr will contain

  'This is  a test of  the  hyphens  remove'

  To remove - and spaces, set delimit to '- '



Printed May 6, 2024, 7:36 am
This article has been viewed/printed 35115 times.