View Single Post
  #1 (permalink)  
Old 12-02-2009, 11:16 AM
mjcoon mjcoon is online now
Basic4ppc Expert
 
Join Date: May 2008
Location: Berkshire, UK
Posts: 810
Awards Showcase
Beta Tester 
Total Awards: 1
Default Split string with multiple separators

I have a requirement which might not be specific to me... I put the suggestion here even though it might best be met by an extension of StringsEx.dll.

The strings I want to split have been crudely formatted with tabs and spaces to render into columns when using a fixed-width font. Fortunately all columns have a visible character, so when correctly split no element would be null.

Unfortunately the StrSplit(string, "") function will, quite reasonably, treat each white-space character as delineating a new column.

Could we have a version that ignores multiple whitespace? Or a function that does not do a split but contracts all whitespace into, say, a single space? I think it would need a StringBuilder object to do this reasonably efficiently in Basic4PPC code.

Mike.
Reply With Quote