+ Reply to Thread
Results 1 to 2 of 2

Thread: Removing and replacing a specific character only from a string

  1. #1
    joey
    Guest

    Question Removing and replacing a specific character only from a string

    I'd like a small tutorial that shows how to remove/replac a specific character only from a string.

    Thanks a lot.
    Last edited by joey; 10-31-2012 at 03:18 AM.

  2. #2
    Junior Member
    Join Date
    May 2012
    Posts
    36
    So let`s say you want to remove or replace the first character of a string or even replace a part of string
    with another string.

    To Remove the first three characters from a string :
    Code:
                    string text = "my name is john";
                    text = text.Remove(0, 3);
    				// Text will now equal "name is john"
    To Replace a part of string with another string :
    Code:
                    string text = "my name is john";
                    text = text.Replace("john", "Mark");
    				// Text will now equal "my name is Mark"

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts