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

String question

Dear friends

I have a large string with the character "*" spread randomly in the string.
My goal is to search the string for the character "*" and retrieve the
string with these removed. How is the best way to achieve this?

Regards Able
Nov 20 '05 #1
3 1341

"Able" <ab**@epost.no> wrote in message
news:0V*****************@news2.e.nsc.no...
Dear friends

I have a large string with the character "*" spread randomly in the string. My goal is to search the string for the character "*" and retrieve the
string with these removed. How is the best way to achieve this?

Regards Able


Well there are a couple of ways to do this depending on what you want to do

String.Split - this will split the string in to an array anywhere is find
the char specified

String.replace - This will replace a char in a string with another char

String.IndexOf - this function will find occurances of a charicter in the
string and return it's place value (0 Based)

Take a look at the String members and you should find something to do what
you want to do...
Mike Bulava
Nov 20 '05 #2
* "Able" <ab**@epost.no> scripsit:
I have a large string with the character "*" spread randomly in the string.
My goal is to search the string for the character "*" and retrieve the
string with these removed. How is the best way to achieve this?


Have a look at the string's 'Replace' method and
'Microsoft.VisualBasic.Strings.Replace'.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Cor
Hi Able,

dim mynewstring as string = myoldstring.replace("*","")

Have a look for more complicated replaces to the other "replace"
methods/functions.

Cor

I have a large string with the character "*" spread randomly in the string. My goal is to search the string for the character "*" and retrieve the
string with these removed. How is the best way to achieve this?

Regards Able

Nov 20 '05 #4

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

Similar topics

32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
2
by: Dan Schumm | last post by:
I'm relatively new to regular expressions and was looking for some help on a problem that I need to solve. Basically, given an HTML string, I need to highlight certain words within the text of the...
53
by: Jeff | last post by:
In the function below, can size ever be 0 (zero)? char *clc_strdup(const char * CLC_RESTRICT s) { size_t size; char *p; clc_assert_not_null(clc_strdup, s); size = strlen(s) + 1;
39
by: sucaba.r | last post by:
I don't know if this is a unique problem, or I'm going about it the wrong way. I currently connect to one of our SQL servers via a priviliged account (by using RUNAS). Works with no problem. I...
7
by: Sky | last post by:
I have been looking for a more powerful version of GetType(string) that will find the Type no matter what, and will work even if only supplied "{TypeName}", not the full "{TypeName},{AssemblyName}"...
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...
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
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
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...
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.