daruffin
asked on
Compare string used as a sentence
The following Code will not except a string with spaces in them, Also it will not work if the first letter is a sash "\" example
\OFFICE 67
\DIRECT
I'm scanning this data into a scanner program I developed using C# it blowes up when it hit a space or a "/"
\OFFICE 67
\DIRECT
I'm scanning this data into a scanner program I developed using C# it blowes up when it hit a space or a "/"
if (!Char.IsLetterOrDigit(e.KeyChar) && e.KeyChar != '\b')
{
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
When I call the method below with ReadChar(new KeyPressEventArgs('/') I get no exception.
So are you sure your code "blows" up where you think it does?
What exception message do you get?
So are you sure your code "blows" up where you think it does?
What exception message do you get?
public void ReadChar(KeyPressEventArgs e)
{
if (!Char.IsLetterOrDigit(e.KeyChar) && e.KeyChar != '\b')
{
}
}
ASKER
I will review it and get back to you tomorrow.
ASKER
Sorry for the delay I have been on Vacation.
The problem is when I scan /INSTALL the first char is changed to ")" meaning when it finishes I have something like this
)NSTALL
it takes the I out and changes the "/" to this ")"
Also it does not work for *INSTALL when I scan it.
The problem is when I scan /INSTALL the first char is changed to ")" meaning when it finishes I have something like this
)NSTALL
it takes the I out and changes the "/" to this ")"
Also it does not work for *INSTALL when I scan it.
ASKER
private void txtbox_KeyPress_Number(obj