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 string problem

Split string problem

Scheduled Pinned Locked Moved ASP.NET
help
4 Posts 3 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 Offline
    L Offline
    lrsalunkhe
    wrote on last edited by
    #1

    Respected, I have a string like JC00123 and I am split this string from from 2th position but it not give proper o/p. It split like this 123 only except the zeros Please help me. Thanks

    S 1 Reply Last reply
    0
    • L lrsalunkhe

      Respected, I have a string like JC00123 and I am split this string from from 2th position but it not give proper o/p. It split like this 123 only except the zeros Please help me. Thanks

      S Offline
      S Offline
      saini arun
      wrote on last edited by
      #2

      Please post the code you have written for splitting the string.

      L 1 Reply Last reply
      0
      • S saini arun

        Please post the code you have written for splitting the string.

        L Offline
        L Offline
        lrsalunkhe
        wrote on last edited by
        #3

        The code is : grno = "JC00234" Dim splitgrno As Int32 = CType(grno.Substring(2), Int32)

        realJSOPR 1 Reply Last reply
        0
        • L lrsalunkhe

          The code is : grno = "JC00234" Dim splitgrno As Int32 = CType(grno.Substring(2), Int32)

          realJSOPR Offline
          realJSOPR Offline
          realJSOP
          wrote on last edited by
          #4
          1. You're using Visual Basic. 1) You're not "splitting" the string, you're extracting part of it. 2) You're converting "000234" to an integer. The integer will be equal to 234. If you want to maintain the leading zeros, you have to leave it as (or convert it back to) a string. 3) I've noticed this leading-zeros on an integer question pop up several times this week. Will you guys please tell your instructors to give you the low-down on this particular topic BEFORE giving you your homework assignment.

          .45 ACP - because shooting twice is just silly
          -----
          "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
          -----
          "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

          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