473,396 Members | 1,834 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,396 software developers and data experts.

replace '

I'm getting a data set returned from a web service and populating a datalist
on my page. There are times that a dataitem has ' in it (ex: car's, truck's,
etc), how can I remove the ' from the words?

instead of seeing car's i want to see cars, trucks, etc.
in VB.NET
Nov 18 '05 #1
3 1131
Use the Replace function:

dim strTest as string = "g't"

strTest = Replace(strTest, "'", "")

msgbox strTest

"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
I'm getting a data set returned from a web service and populating a datalist on my page. There are times that a dataitem has ' in it (ex: car's, truck's, etc), how can I remove the ' from the words?

instead of seeing car's i want to see cars, trucks, etc.
in VB.NET

Nov 18 '05 #2
Well, of course you would have to loop throught each row value in the dataset
and use the replace function on those values. I just wanted to make sure
that is pointed out.

"Jeff Dillon" wrote:
Use the Replace function:

dim strTest as string = "g't"

strTest = Replace(strTest, "'", "")

msgbox strTest

"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
I'm getting a data set returned from a web service and populating a

datalist
on my page. There are times that a dataitem has ' in it (ex: car's,

truck's,
etc), how can I remove the ' from the words?

instead of seeing car's i want to see cars, trucks, etc.
in VB.NET


Nov 18 '05 #3
Hi,

Instead of doing that for every row, SQL Server can do this for you.
Modify your select statement of the dataset from what is now eg.

Select col1 from table1 (col1 is the column with the data like "car's"
to
Select replace(col1,char(61),'') from table1
char(61) is the "'"

"Tampa .NET Koder" <Ta***********@discussions.microsoft.com> wrote in message news:<2C**********************************@microso ft.com>...
Well, of course you would have to loop throught each row value in the dataset
and use the replace function on those values. I just wanted to make sure
that is pointed out.

"Jeff Dillon" wrote:
Use the Replace function:

dim strTest as string = "g't"

strTest = Replace(strTest, "'", "")

msgbox strTest

"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:14**********************************@microsof t.com...
I'm getting a data set returned from a web service and populating a datalist on my page. There are times that a dataitem has ' in it (ex: car's, truck's, etc), how can I remove the ' from the words?

instead of seeing car's i want to see cars, trucks, etc.
in VB.NET


Nov 18 '05 #4

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

Similar topics

4
by: Craig Keightley | last post by:
Can these lines of sql statements be consolidated into one sql statement (possibly using reg exps??) BEGIN CODE ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Update...
12
by: Barnes | last post by:
Does anyone know of a good way to use the JavaScript string.replace() method in an ASP form? Here is the scenario: I have a form that cannot accept apostrophes. I want to use the replace() so...
6
by: Danny | last post by:
I need an asp command to strip out from a string all extra punctuation such as apostrophe, comma, period, spaces dashes, etc etc and just leave the letters. Can anybody give me some ideas? ...
9
by: Peter Row | last post by:
Hi, I know this has been asked before, but reading the threads it is still not entirely clear. Deciding which .Replace( ) to use when. Typically if I create a string in a loop I always use a...
4
by: Cor | last post by:
Hi Newsgroup, I have given an answer in this newsgroup about a "Replace". There came an answer on that I did not understand, so I have done some tests. I got the idea that someone said,...
3
by: Goran Djuranovic | last post by:
Hi all, I ran into a problem where my XMLTextReader fails on .Read() when I have "<" character in one of the attribute's values. What I am trying to do is replace illegal characters ("<", "&" ,...
3
by: TOXiC | last post by:
Hi everyone, First I say that I serched and tryed everything but I cannot figure out how I can do it. I want to open a a file (not necessary a txt) and find and replace a string. I can do it...
6
by: JackpipE | last post by:
Here is my replace query and I need to run this on every column in my table. Right now I manually enter the column name (_LANGUAGES_SPOKEN) but this is time consuming and would like to automate...
5
by: V S Rawat | last post by:
I was trying to use back-to-back replace functions to convert a url: str1 = str.replace("%2F","/").replace("%3F","?").replace("%3D","=").replace("%2 6","&"); It didn't replace all 4 types of...
15
by: =?Utf-8?B?TWlrZSAiWU9fQkVFIiBC?= | last post by:
I have a text file that contains about 8 to 10 text sequences that I need to replace. I want to search and replace all 8 to 10 text sequence anytime I run this script Here is what I have so...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
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...
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
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...
0
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...
0
tracyyun
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...
0
agi2029
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,...

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.