473,387 Members | 3,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help with text box string manipulation...

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
Nov 20 '05 #1
6 1444
Hi,

If TextBox1.Text.IndexOf(".") < 0 Then TextBox1.Text += "."

Ken

----------------------------

"Gary" <sp**@spam.com> wrote in message
news:eu****************@TK2MSFTNGP12.phx.gbl...
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

Nov 20 '05 #2
The instr() method will give you the true or false.
The replace() method will add the . at the end.

Sean
-----Original Message-----
Hi...

I have a number in a text box say "745" I want to find in that text boxanywhere (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
.

Nov 20 '05 #3
The instr() method will give you the true or false.
The replace() method will add the . at the end.

Sean
-----Original Message-----
Hi...

I have a number in a text box say "745" I want to find in that text boxanywhere (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
.

Nov 20 '05 #4
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.
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:e5*************@tk2msftngp13.phx.gbl...
Hi,

If TextBox1.Text.IndexOf(".") < 0 Then TextBox1.Text += "."

Ken

----------------------------

"Gary" <sp**@spam.com> wrote in message
news:eu****************@TK2MSFTNGP12.phx.gbl...
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


Nov 20 '05 #5
* "Gary" <sp**@spam.com> scripsit:
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'.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #6
* "Ken Tucker [MVP]" <vb***@bellsouth.net> scripsit:
If TextBox1.Text.IndexOf(".") < 0 Then TextBox1.Text += "."


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

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tad Johnson | last post by:
Hi all, I would not normally post about this issue but after a few hours of struggling maybe it's time for some help. I am a pascal programmer moving to C++. I am learning from a couple of...
8
by: yerk5 | last post by:
Does js have some way of doing what I want here: I want to paste a multiline block of text into a TEXTAREA form field, and there is data in the block of text that I want to extract into a...
1
by: Andrew Poulos | last post by:
Say I have a page, which has been created by a third party, and the page may contain some pre-specified text. How can I find and replace that text dynamically? For example, if the page I have...
8
by: DKM | last post by:
Here are the source code files to a Java applet that utilizes LiveConnect to communicate with Javascript, and the HTML file. The thing works both in IE 6.0 and FireFox 1.4. but with some...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
2
by: UJ | last post by:
I've got a text box that I'm going to be doing some manipulation on (selecting text, moving stuff around, that kind of thing) but I don't want/need the user to see it while it's going on. I'd like...
4
by: WaterWalk | last post by:
Hello, I'm currently learning string manipulation. I'm curious about what is the favored way for string manipulation in C, expecially when strings contain non-ASCII characters. For example, if...
0
by: JosAH | last post by:
Greetings, welcome back; above we discussed the peripherals of the Library class: loading and saving such an instantiation of it, the BookMark interface and then some. This part of the article...
1
by: blangela | last post by:
Bjarne Stroustrup has a new text coming out called "Programming: Principles and Practice Using C++" (ISBN: 0321543726), due to be published in December of this year. Some of the features of this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.