Hey guys,
I have a textbox where I want to find any spaces in the text and convert
them to underscores _. Can someone please give some help with this one?
Thank you,
Kevin 6 3009
Use the Replace function.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Kevin O'Brien" <ke******@usa.netwrote in message news:uv*************@TK2MSFTNGP06.phx.gbl...
Hey guys,
I have a textbox where I want to find any spaces in the text and convert them to underscores _.
Can someone please give some help with this one?
Do I have to read the text character by character and replace as I find
spaces or can I create a vairable equal to textbox.text and run replace
against that variable.
thank you for your help.
kevin
"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:OP**************@TK2MSFTNGP06.phx.gbl...
Use the Replace function.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Kevin O'Brien" <ke******@usa.netwrote in message
news:uv*************@TK2MSFTNGP06.phx.gbl...
>Hey guys,
>I have a textbox where I want to find any spaces in the text and convert them to underscores _. Can someone please give some help with this one?
I got it. This is what I did...
Dim removespaces As String
removespaces = TextBox1.Text
TextBox2.Text = Replace(removespaces, " ", "_")
Thank you,
Kevin
"Kevin O'Brien" <ke******@usa.netwrote in message
news:uy**************@TK2MSFTNGP06.phx.gbl...
Do I have to read the text character by character and replace as I find
spaces or can I create a vairable equal to textbox.text and run replace
against that variable.
thank you for your help.
kevin
"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:OP**************@TK2MSFTNGP06.phx.gbl...
>Use the Replace function. Juan T. Llibre, asp.net MVP asp.net faq : http://asp.net.do/faq/ foros de asp.net, en español : http://asp.net.do/foros/ =================================== "Kevin O'Brien" <ke******@usa.netwrote in message news:uv*************@TK2MSFTNGP06.phx.gbl...
>>Hey guys,
>>I have a textbox where I want to find any spaces in the text and convert them to underscores _. Can someone please give some help with this one?
I was about to post an example.
Yes, that's exactly the solution.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Kevin O'Brien" <ke******@usa.netwrote in message news:%2****************@TK2MSFTNGP02.phx.gbl...
>I got it. This is what I did...
Dim removespaces As String
removespaces = TextBox1.Text
TextBox2.Text = Replace(removespaces, " ", "_")
Thank you,
Kevin
"Kevin O'Brien" <ke******@usa.netwrote in message news:uy**************@TK2MSFTNGP06.phx.gbl...
>Do I have to read the text character by character and replace as I find spaces or can I create a vairable equal to textbox.text and run replace against that variable.
thank you for your help.
kevin
"Juan T. Llibre" <no***********@nowhere.comwrote in message news:OP**************@TK2MSFTNGP06.phx.gbl...
>>Use the Replace function. Juan T. Llibre, asp.net MVP asp.net faq : http://asp.net.do/faq/ foros de asp.net, en español : http://asp.net.do/foros/ =================================== "Kevin O'Brien" <ke******@usa.netwrote in message news:uv*************@TK2MSFTNGP06.phx.gbl... Hey guys,
I have a textbox where I want to find any spaces in the text and convert them to underscores _. Can someone please give some help with this one?
If you are going to be doing this in various places, consider making it into
a static (Shared in VB.NET) method in a Utilities class:
Public Shared Function SpacesToUnderscores( ByVal inputText as String) As
String
Return inputText.Replace(" ","_")
End Function
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"Kevin O'Brien" wrote:
I got it. This is what I did...
Dim removespaces As String
removespaces = TextBox1.Text
TextBox2.Text = Replace(removespaces, " ", "_")
Thank you,
Kevin
"Kevin O'Brien" <ke******@usa.netwrote in message
news:uy**************@TK2MSFTNGP06.phx.gbl...
Do I have to read the text character by character and replace as I find
spaces or can I create a vairable equal to textbox.text and run replace
against that variable.
thank you for your help.
kevin
"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:OP**************@TK2MSFTNGP06.phx.gbl...
Use the Replace function.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Kevin O'Brien" <ke******@usa.netwrote in message
news:uv*************@TK2MSFTNGP06.phx.gbl... Hey guys,
I have a textbox where I want to find any spaces in the text and convert them to underscores _. Can someone please give some help with this one?
Nice! Thank you both for your excellent help!
Kevin
"Peter Bromberg [C# MVP]" <pb*******@yahoo.yabbadabbadoo.comwrote in
message news:12**********************************@microsof t.com...
If you are going to be doing this in various places, consider making it
into
a static (Shared in VB.NET) method in a Utilities class:
Public Shared Function SpacesToUnderscores( ByVal inputText as String) As
String
Return inputText.Replace(" ","_")
End Function
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"Kevin O'Brien" wrote:
>I got it. This is what I did...
Dim removespaces As String removespaces = TextBox1.Text
TextBox2.Text = Replace(removespaces, " ", "_")
Thank you,
Kevin "Kevin O'Brien" <ke******@usa.netwrote in message news:uy**************@TK2MSFTNGP06.phx.gbl...
Do I have to read the text character by character and replace as I find
spaces or can I create a vairable equal to textbox.text and run replace
against that variable.
thank you for your help.
kevin
"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:OP**************@TK2MSFTNGP06.phx.gbl... Use the Replace function. Juan T. Llibre, asp.net MVP asp.net faq : http://asp.net.do/faq/ foros de asp.net, en español : http://asp.net.do/foros/ =================================== "Kevin O'Brien" <ke******@usa.netwrote in message news:uv*************@TK2MSFTNGP06.phx.gbl... Hey guys,
I have a textbox where I want to find any spaces in the text and convert them to underscores _. Can someone please give some help with this one?
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Eric Lilja |
last post by:
Hello, I've made a templated class Option (a child of the abstract base
class OptionBase) that stores an option name (in the form someoption=) and
the value belonging to that option. The value is...
|
by: PeteC |
last post by:
I'm working on a web page which has some form elements in it which I need to
manipulate using JavaScript.
If the element is (for example, in a form called TicketForm)
<INPUT...
|
by: larry |
last post by:
Hi,
I am a newbie to Internet programming. I have some questions about
spacing in HTML control names and subsequently being able to access
these input elements in JavaScript If you don't have...
|
by: Todd |
last post by:
Hello,
I'm am creating a CSV text import file for another application from my
Access database. The other application requires a leading and following
space surrounding a hyphen in the field...
|
by: Brian Henry |
last post by:
first question... I have a flat file which unfortinuatly has columns
seperated by nulls instead of spaces (a higher up company created it this
way for us) is there anyway to do a readline with this...
|
by: Sergei Riaguzov |
last post by:
I have a very strange behaviour with POST keys.
Consider a test:
wtf.html:
=== Cut ===
<form action="eh.php" method="POST">
<input type="checkbox" name="many spaces and. . dots. . "/>...
|
by: yawnmoth |
last post by:
Say I have the following script - test.php:
<?
if (count($_GET) != 0)
{
foreach(array_keys($_GET) as $var)
{
echo "$var<br />";
}
}
|
by: gregnowlives |
last post by:
Hi i've created a simple website which allows our intranet users to add
files from shared drives on the domain and structure them on web pages.
(bit like sharepoint). These files are then displayed...
|
by: Jeff |
last post by:
I have a legacy database table that has spaces in the field names.
So I have a form that looks like this:
<input type="text" name="name with space" value="some_value">
on the server I have:...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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,...
|
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: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |