Thanks Jarod.
That wasn't exactly what I was looking for, but it put me on the right
track.
so..
private string CustomTrimEnd(
string Original,
string TrimChar)
{
Regex r = new Regex(
string.Format("[{0}]+$", TrimChar),
RegexOptions.IgnoreCase);
return r.Split(Original)[0];
}
private string CustomTrimStart(
string Original,
string TrimChar)
{
Regex r = new Regex(
string.Format("^[{0}]+", TrimChar),
RegexOptions.IgnoreCase);
return r.Split(Original)[1];
}
//code from a quick test app
When I move this into the app the same trim char will be used many
times. So, I won't be recreating the pattern every time (just on init).
Again, thanks for the help.
-Dan
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!