Showing posts with label box. Show all posts
Showing posts with label box. Show all posts

Saturday, March 31, 2012

String Stripping

Hi,

I am trying to create a page that will check user input against a value in database. This page will have a text box for user to enter serial #.
Serial # length is variable but last 3 digit is always number.
For examples:
W04051234-PAY001 in this example code is 1234-PAY
W05051234-PAT002 in this example code is 1234-PAT

A12056040-G001 in this example code is 6040-G
B11056080-SU001 in this example code is 6080-s

Which is the best approach to extract CODE from user input?

Any help will be appriciated.

Thank

TekinUse the Regular Expression class, RegExp with a regular expression that looks for:
4 digits (or is it 3?) followed by
dash
followed by 1 or letters

That expression is:
\d{4}\-[A-Za-z]+
Actually,

I would like to Trancate first 5 digits and last 3 digits.

For examples:
W04051234-PAY001 in this example code is 1234-PAY
If you are attempting to strip a specific group of characters, the String class has numerous useful methods. I encourage you to read about the String class in the .net docs. I think the SubString() and Length() methods will be useful.

String To Decimal

Hi,

How can I convert from string (Text Box) to Decimal (addition some entries then get result)

Thanks,

http://tinyurl.com/aqpgm

To Decimal method.

Please can u write thz method

sorry for disturbing


cavalry wrote:

Please can u write thz method

Scroll down just a little bit on that link above and therz the method in both VB and C#


Hi again,

i see the like but

Access to the requested URL is not allowed!

there is a ristriction to it in my city, so plz copy a paste here

sorry again


thank u its DONE

i've Declare

Dim Grade1 as Double=Grade1.Text

Dim Grade2 as Double=Grade2.Text

Dim Grade as double = Grade1+Grade2

Thanks Alot

Saturday, March 24, 2012

Stripping characters...

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 = @dotnet.itags.org."*\John Doe";
string pattern = @dotnet.itags.org."^.*\\";
string name = Regex.Replace(fname, pattern," ");

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

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

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.comHave you tried

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

--
Regards

John Timney
Microsoft MVP

"VJ" <vncntj@.hotmail.com> wrote in message
news:%23jugUr6GGHA.532@.TK2MSFTNGP15.phx.gbl...
> 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

Stripping characters...

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 = @dotnet.itags.org."*\John Doe";
string pattern = @dotnet.itags.org."^.*\\";
string name = Regex.Replace(fname, pattern," ");
but how can i do it for a passed variable...
like @dotnet.itags.org.Request.Form["fname"];
string fname = @dotnet.itags.org.Request.Form["fname"];
string pattern = @dotnet.itags.org."^.*\\";
string name = Regex.Replace(fname, pattern," ");
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.comHave you tried
string pattern = @."^.*\\";
string name = Regex.Replace(Request.Form["fname"], pattern," ");
Regards
John Timney
Microsoft MVP
"VJ" <vncntj@.hotmail.com> wrote in message
news:%23jugUr6GGHA.532@.TK2MSFTNGP15.phx.gbl...
> 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