String question

  • Thread starter Thread starter Able
  • Start date Start date
A

Able

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
 
Able said:
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
 
* "Able said:
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'.
 
Hi Able,

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

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

Cor
 
Back
Top