Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Stripping characters...

Reply
Thread Tools

Stripping characters...

 
 
VJ
Guest
Posts: n/a
 
      01-17-2006
I'm trying to strip the characters from a text box...
but I only know how to apply it to text...
for example..


string fname = @"*\John Doe";
string pattern = @"^.*\\";
string name = Regex.Replace(fname, pattern," ");


but how can i do it for a passed variable...
like @Request.Form["fname"];

string fname = @Request.Form["fname"];
string pattern = @"^.*\\";
string name = Regex.Replace(fname, pattern," ");

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
 
Reply With Quote
 
 
 
 
John Timney \( MVP \)
Guest
Posts: n/a
 
      01-17-2006
Have you tried

string pattern = @"^.*\\";
string name = Regex.Replace(Request.Form["fname"], pattern," ");


--
Regards

John Timney
Microsoft MVP

"VJ" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I'm trying to strip the characters from a text box...
> but I only know how to apply it to text...
> for example..
>
>
> string fname = @"*\John Doe";
> string pattern = @"^.*\\";
> string name = Regex.Replace(fname, pattern," ");
>
>
> but how can i do it for a passed variable...
> like @Request.Form["fname"];
>
> string fname = @Request.Form["fname"];
> string pattern = @"^.*\\";
> string name = Regex.Replace(fname, pattern," ");
>
> --
> Sent via .NET Newsgroups
> http://www.dotnetnewsgroups.com



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stripping out punctuation marks dew ASP .Net 1 02-07-2006 12:06 AM
Request.QueryString() is stripping out French characters =?Utf-8?B?THU=?= ASP .Net 4 09-02-2005 09:02 AM
stripping tags from source on render Lance ASP .Net 4 06-17-2005 05:32 PM
Stripping out email addresses Kelly Perl 1 04-28-2004 09:56 PM
regex for stripping HTML Michael Vilain Perl 4 10-30-2003 01:06 PM



Advertisments