Help with text box string manipulation...

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

Hi...

I have a number in a text box say "745" I want to find in that text box
anywhere (True or False) if a "." exists, if not I want to add at the end
(right) a "." so "745" would be "745."

any ideas on how to search a text box for the following "."?

Thanks,

Gary
 
The instr() method will give you the true or false.
The replace() method will add the . at the end.

Sean
 
The instr() method will give you the true or false.
The replace() method will add the . at the end.

Sean
 
Absolute perfect...

Thanks Ken

Gary

p.s. I know what I want to most of the time, but trying to learn the syntax
in vb.net as apposed to vb6 is a big leap in my words for me.
 
* "Gary said:
I have a number in a text box say "745" I want to find in that text box
anywhere (True or False) if a "." exists, if not I want to add at the end
(right) a "." so "745" would be "745."

any ideas on how to search a text box for the following "."?

Have a look at 'InStr' and/or 'String.IndexOf'.
 
* "Ken Tucker said:
If TextBox1.Text.IndexOf(".") < 0 Then TextBox1.Text += "."

Recommendation: Use the '&' operator to concatenate strings instead
of using the '+' operator.
 
Back
Top