Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

regex how to find the " char in a string

Status
Not open for further replies.

StylizIT

Programmer
Dec 4, 2003
62
0
0
NL
anyone know the expression to find the " character in a string?


You can better regret that you have done something than regret the fact you done nothing
 
try this
Code:
Match MyRegMatch = Regex.Match(_input,"\"");		
if(MyRegMatch.Success)  
{
Console.WriteLine("good string " + _input);
}
else
{
Console.WriteLine("bad string " + _input);
}

Marty
 
thanks for the help, but I already fixed my problem:)
I used regex.ismatch(me.text, "\W").

The problem I'm facing now is that I also want to check if the first char in a string is a space with regex. If so it should return false.

You can better regret that you have done something than regret the fact you done nothing
 
try this
Match MyRegMatch = Regex.Match(_input,"^[\\S]");
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top