PDA

View Full Version : Trim a String


ccowgill
2008-03-19, 06:40 PM
Is there a way to trim a string so only a particular pattern is left, using wildcards or something similar?

if the string matches this pattern:
*`,*`,*`,*`,*.*

eliminate everything except this pattern:
`,*.

ccowgill
2008-03-24, 05:41 PM
I found somewhat of a work around, if I replace the . with a : I can just trim the string from either side, using the : as my uncommon character. It works just as long as their are no : in the default string, which based on our company standards there shouldn't be