Link to home
Create AccountLog in
Avatar of MikeMCSD
MikeMCSDFlag for United States of America

asked on

Search a string then replace

In C#, I need to search the beginning of a string and replace it with an empty string:

The name is at the beginning, for example, the name:   Ancient Secrets

Search string:  Ancient Secrets Neti-Pot, Nasal Cleansing Pot

would be after:  Neti-Pot, Nasal Cleansing Pot

I just want to remove the brand name at the beginning of the product name.
thanks


SOLUTION
Avatar of Saqib Khan
Saqib Khan
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
do you know the brand names?or have a list of them
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER CERTIFIED SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of MikeMCSD

ASKER

thanks everyone . .

this worked well:

  p.Name.Substring(p.Manufacturer.Name.Length + 1)