kumar
kumar

Reputation: 2944

how to omit the - in the string?

I have a string like this:

string Fname = name - shiva;

While assigning to the other string I need remove the - in between.

Can anybody help me out?

Upvotes: 0

Views: 100

Answers (1)

Justin Ethier
Justin Ethier

Reputation: 134167

Did you mean that you have something like this:

string Fname = "name - shiva";

In any case, try:

myString.replace("-", "")

You can customize as needed to meet your needs...

Upvotes: 2

Related Questions