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. Web Development
  3. ASP.NET
  4. Split a String?

Split a String?

Scheduled Pinned Locked Moved ASP.NET
question
6 Posts 5 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.
  • K Offline
    K Offline
    Kasi Viswanathan
    wrote on last edited by
    #1

    I am having a string in format(KSERVER/Name)...Now i want only the Name,How can i split?....I dont want to use Substring method. Thanks in Advance...:rose:

    N P R G 4 Replies Last reply
    0
    • K Kasi Viswanathan

      I am having a string in format(KSERVER/Name)...Now i want only the Name,How can i split?....I dont want to use Substring method. Thanks in Advance...:rose:

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      Split it with /, you will get a string array. From that you can take name easily

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

      1 Reply Last reply
      0
      • K Kasi Viswanathan

        I am having a string in format(KSERVER/Name)...Now i want only the Name,How can i split?....I dont want to use Substring method. Thanks in Advance...:rose:

        P Offline
        P Offline
        ps srinivasan
        wrote on last edited by
        #3

        Dim arr() As String Dim n As Int16 Dim str As String = "KSERVER/Name" arr = Split(str, "/") 'using / split the sring For n = 0 To UBound(arr) MessageBox.Show(arr(n)) Next i think this code will help u. by srinivasan.s

        1 Reply Last reply
        0
        • K Kasi Viswanathan

          I am having a string in format(KSERVER/Name)...Now i want only the Name,How can i split?....I dont want to use Substring method. Thanks in Advance...:rose:

          R Offline
          R Offline
          r a j u u
          wrote on last edited by
          #4

          Dim arr() As String Dim n As Int16 Dim str As String = "KSERVER/Name" arr = Split(str, "/") 'using / split the sring For n = 0 To UBound(arr) MessageBox.Show(arr(n)) Next try this code....

          Rajendran

          1 Reply Last reply
          0
          • K Kasi Viswanathan

            I am having a string in format(KSERVER/Name)...Now i want only the Name,How can i split?....I dont want to use Substring method. Thanks in Advance...:rose:

            G Offline
            G Offline
            Guffa
            wrote on last edited by
            #5

            Kasi Viswanathan wrote:

            I dont want to use Substring method.

            Why not? That's the most efficient way of getting a part of a string. Use the IndexOf method to get the location of the "/" character, then use Substring to get the part of the string after that: string name = path.Substring(path.IndexOf('/') + 1);

            --- "Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things." -- Douglas Adams

            K 1 Reply Last reply
            0
            • G Guffa

              Kasi Viswanathan wrote:

              I dont want to use Substring method.

              Why not? That's the most efficient way of getting a part of a string. Use the IndexOf method to get the location of the "/" character, then use Substring to get the part of the string after that: string name = path.Substring(path.IndexOf('/') + 1);

              --- "Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things." -- Douglas Adams

              K Offline
              K Offline
              Kasi Viswanathan
              wrote on last edited by
              #6

              Tanx for ur reply...:rose:

              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