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. new Char[]

new Char[]

Scheduled Pinned Locked Moved C#
data-structureshelpquestion
4 Posts 4 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.
  • N Offline
    N Offline
    Navneet Hegde
    wrote on last edited by
    #1

    HI ., I have a string like "[Hi All]" and now I want to Replace Characters [,], and Space I am Trying to Do it : String.Replace(new Char[] {'[',']'},new Char[] (''}) But This is giving error . Question Can we do it this way , I mean replace array of Characters with Space in one Go. Thanks in advance

    Develop2Program & Program2Develop

    P E X 3 Replies Last reply
    0
    • N Navneet Hegde

      HI ., I have a string like "[Hi All]" and now I want to Replace Characters [,], and Space I am Trying to Do it : String.Replace(new Char[] {'[',']'},new Char[] (''}) But This is giving error . Question Can we do it this way , I mean replace array of Characters with Space in one Go. Thanks in advance

      Develop2Program & Program2Develop

      P Offline
      P Offline
      phannon86
      wrote on last edited by
      #2

      What error does it give? Looks to me like you've just got the syntax very very wrong. What you need is something more like: myString.Replace('x', 'y'); Which would replace all instances of x in that String with y.

      He who makes a beast out of himself gets rid of the pain of being a man

      1 Reply Last reply
      0
      • N Navneet Hegde

        HI ., I have a string like "[Hi All]" and now I want to Replace Characters [,], and Space I am Trying to Do it : String.Replace(new Char[] {'[',']'},new Char[] (''}) But This is giving error . Question Can we do it this way , I mean replace array of Characters with Space in one Go. Thanks in advance

        Develop2Program & Program2Develop

        E Offline
        E Offline
        ehuysamer
        wrote on last edited by
        #3

        Try this... result = MyString.Replace('[','').Replace(']','')

        1 Reply Last reply
        0
        • N Navneet Hegde

          HI ., I have a string like "[Hi All]" and now I want to Replace Characters [,], and Space I am Trying to Do it : String.Replace(new Char[] {'[',']'},new Char[] (''}) But This is giving error . Question Can we do it this way , I mean replace array of Characters with Space in one Go. Thanks in advance

          Develop2Program & Program2Develop

          X Offline
          X Offline
          Xmen Real
          wrote on last edited by
          #4

          here is code :

          string string1 = "[Hi All]";
          string1 = string1.Replace("[","").Replace("]","").Replace(" ","");

          TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y -------------------------------------------------------- 128 bit encrypted signature, crack if you can

          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