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. Visual Basic
  4. SPLIT()

SPLIT()

Scheduled Pinned Locked Moved Visual Basic
help
2 Posts 2 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.
  • M Offline
    M Offline
    Mr kilany
    wrote on last edited by
    #1

    hi, i need to use split() but i need to split string depends on complete word such as "welcome" and i put split("welcome") but the problem that the string include just three welcome but it gave me more that 60 when i asked lines.length-1 and when i but instead of welcome "w" letter and used split("w") it gave me the wanted value which is 3 i dont know why , i need to split whole word please help me

    kilany

    G 1 Reply Last reply
    0
    • M Mr kilany

      hi, i need to use split() but i need to split string depends on complete word such as "welcome" and i put split("welcome") but the problem that the string include just three welcome but it gave me more that 60 when i asked lines.length-1 and when i but instead of welcome "w" letter and used split("w") it gave me the wanted value which is 3 i dont know why , i need to split whole word please help me

      kilany

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

      It looks like VB is "helpful" here, and automatically converts your string to an array of characters, so that you are splitting on any of the characters in the string, not the whole string. Put the string in an array of strings and use the array in the call to Split. If you only want to count the occurances, a Regex is better suited for this.

      --- b { font-weight: normal; }

      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