473,396 Members | 1,895 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.

Q: remove a certain string in string

Hello,
I have a string and I want to remove only certain string, if exits. Here is
an example: “ABC,FCG,XXX,FFA”, I need to remove XXX and keep the rest in the
string, how can I do that?
Thanks,
Jim.

Nov 19 '05 #1
2 1361
str.Replace("XXX","")
or more safe
str.Replace(",XXX,",",,")
HTH,

Elton Wang
-----Original Message-----
Hello,
I have a string and I want to remove only certain string, if exits. Here is an example: ?oABC,FCG,XXX,FFA?, I need to remove XXX and keep the rest in the string, how can I do that?
Thanks,
Jim.

.

Nov 19 '05 #2
And if you need a little more flexibility, you could try Regex.Replace()

Elton Wang wrote:
str.Replace("XXX","")
or more safe
str.Replace(",XXX,",",,")
HTH,

Elton Wang

-----Original Message-----
Hello,
I have a string and I want to remove only certain string,


if exits. Here is
an example: ?oABC,FCG,XXX,FFA?, I need to remove XXX


and keep the rest in the
string, how can I do that?
Thanks,
Jim.

.

Nov 19 '05 #3

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

Similar topics

3
by: soni29 | last post by:
hi, how can i remove a string from an existing string in javascript. i have a textbox in a form and want to make sure that when the user clicks a button that certain words are moved, like all...
8
by: Joseph | last post by:
I have a textBox that people writes stories in it. They can use for format. I have Aspell installed on the server, so people can make correction to their text. Sometimes, they forget to add a...
18
by: prasanna.hariharan | last post by:
Hi guys, I want to remove certain words from a c++ string. The list of words are in a file with each word in a new line. I tried using the std::transform, but it dint work. Anybody got a clue...
5
by: Ahmed | last post by:
Hi all, Is there any way to replace a script I registered in Page Load with the method Page.RegisterStartupScript
19
by: Carson | last post by:
Is it possible to remove the dashes in a social security number using sprintf? If so what would the syntax look like? If sprintf won't do this is there a C function that will?
8
by: Paul | last post by:
Hi, My VB is very rusty I'm afraid! What would be the most efficient way to remove the following ASCII characters from a string? ...
4
by: O.B. | last post by:
I need the ability to parse through the values of a Dictionary and remove certain ones depending on their attribute values. In the example below, an InvalidOperationException is thrown in the...
26
by: Brad | last post by:
I'm writing a function to remove certain characters from strings. For example, I often get strings with commas... they look like this: "12,384" I'd like to take that string, remove the comma...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.