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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. how to split string

how to split string

Scheduled Pinned Locked Moved C#
csharptutorial
4 Posts 3 Posters 1 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.
  • S Offline
    S Offline
    sooreeagt
    wrote on last edited by
    #1

    hai i want to splir string and i want keep two parts of that string into 2 string variables can u plz send me the code in c#

    Suresh.R

    M V 2 Replies Last reply
    0
    • S sooreeagt

      hai i want to splir string and i want keep two parts of that string into 2 string variables can u plz send me the code in c#

      Suresh.R

      M Offline
      M Offline
      Martin 0
      wrote on last edited by
      #2

      Hello, Use the Split method of the string class. This will return a string[]. Try and ask again if you need more help. All the best, Martin

      1 Reply Last reply
      0
      • S sooreeagt

        hai i want to splir string and i want keep two parts of that string into 2 string variables can u plz send me the code in c#

        Suresh.R

        V Offline
        V Offline
        Vinay Dornala
        wrote on last edited by
        #3

        hi string[] str=string.split(''); example: string s="xxx yyy zzzz"; if u want to split string with whitespace then write this string[] str=s.split(' '); i hope this works fine

        M 1 Reply Last reply
        0
        • V Vinay Dornala

          hi string[] str=string.split(''); example: string s="xxx yyy zzzz"; if u want to split string with whitespace then write this string[] str=s.split(' '); i hope this works fine

          M Offline
          M Offline
          Martin 0
          wrote on last edited by
          #4

          Hello shakeela! The reason why I didn't gave an example in my answer, was the "send me the code in c#" statement in the question. This is mostely a sign of a "Please do my homework for me, because I don't whant to lose time by thinking myself!" question! All the best, Martin

          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