Remove from a string

In this chapter you will learn:

  1. How to remove sub string from a string

Remove sub string from a string

using System;/*from   j a  va 2s . c  o  m*/

class Sample
{
    public static void Main()
    {
        string s = "java2s.com";

        s = s.Remove(2, 3);
        Console.WriteLine(s);
    }
}

The output:

Next chapter...

What you will learn in the next chapter:

  1. How to get the sub string from the start of a string
  2. How to get the sub string from the middle
Home » C# Tutorial » String
string
String creation
Char in string
Compare strings
String equality
String concatanation
String copy
String Join
String split
String Search for Index
String contains
String start with
String insert
String case
Replacing substring
Remove from a string
Substring
Escape Characters
String verbatim
String padding
Switch on String
String trim
String intern
String normalization
Empty String