Delete substring in string giving that substring

How can i delete a specific substring in a string in asp Is there any method doing this eg. I have the string "Hello World" and i want to cut the substring "lo Wo" so that i get back "Helrld"

Thank you



Answer this question

Delete substring in string giving that substring

  • feby

    string _str_helloworld = "Hello World";

    _str_helloworld.Remove(startindex,lenght)

    This should do the trick.


  • ayya

    Perhaps you meant the specific text:

    then you could use

    _str_helloworld .Replace("ello w","");



  • dwj

    you can use method replace for that

    something like could do

    string hello = "Hello Word";
    string result = hello.Replace("lo Wo","");

    Hope this will help


  • Delete substring in string giving that substring