Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to remove characters from string value

How to remove characters from string value

Scheduled Pinned Locked Moved C#
helptutorial
24 Posts 9 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Lost User

    Abhinav S wrote:

    string.Rmpty;

    Now that is funny. :laugh:

    I must get a clever new signature for 2011.

    N Offline
    N Offline
    Not Active
    wrote on last edited by
    #21

    string.Rmpty is perfectly acceptable syntax with the Scooby-Do extensions installed. :-D


    I know the language. I've read a book. - _Madmatt

    1 Reply Last reply
    0
    • L Lost User

      Abhinav S wrote:

      string.Rmpty;

      Now that is funny. :laugh:

      I must get a clever new signature for 2011.

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #22

      Is fixed now.

      The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it. My latest tip/trick

      1 Reply Last reply
      0
      • S ShilpaKumari

        I want to remove , and . From string value but i don't know how to do that. I h've such type of string value string

        str ="abc, d.e f,g h,i. J,k"

        plz help me

        P Offline
        P Offline
        Paladin2000
        wrote on last edited by
        #23

        Try this.

        string str = "abc, d.e f,g h,i. J,k";
        str = str.Replace(',', string.Empty).Replace('.', string.Empty);

        1 Reply Last reply
        0
        • R RaviRanjanKr

          you can simply remove , and . from your string value by using Split function. take a look how to display

          string str = "abc, d.e f,g h,i. j,k";
          string[] arr = str.Split(',', '.'); // remove all , and .
          foreach (string str1 in arr)
          {
          Console.Write(str1); //output abc de fg hi jk
          }

          modified on Monday, January 24, 2011 1:04 AM

          R Offline
          R Offline
          RaviRanjanKr
          wrote on last edited by
          #24

          I have done Minor changes in my answer

          string str = "abc, d.e f,g h,i. j,k";
          string[] arr = str.Split(',', '.'); // remove all , and .
          str = string.Empty; // Changes here
          foreach (string str1 in arr)
          {
          str += str1;
          }
          Console.WriteLine(str); //output abc de fg hi jk

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups