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. StringSplitOptions

StringSplitOptions

Scheduled Pinned Locked Moved C#
helptutorialquestion
3 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.
  • E Offline
    E Offline
    eyalso
    wrote on last edited by
    #1

    i have problem with next code - " could not found StringSplitOptions" string text = "This is my string"; string[] words = text .Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries); TotalWords = words.Length; is anybody knows how to deal wit hthe problem ? eyalso

    J A 2 Replies Last reply
    0
    • E eyalso

      i have problem with next code - " could not found StringSplitOptions" string text = "This is my string"; string[] words = text .Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries); TotalWords = words.Length; is anybody knows how to deal wit hthe problem ? eyalso

      J Offline
      J Offline
      jeyapandian
      wrote on last edited by
      #2

      hi, dont know how good is this method.i did like this last time String tmp =Words; do while(tmp.indexOf(" ")>0) // Do while you find two continuous spaces and remove those.. { tmp = tmp.Replace(" "," "); } int TotalWords = tmp.Split(' ').Length; Where there is a will,there is a way.

      1 Reply Last reply
      0
      • E eyalso

        i have problem with next code - " could not found StringSplitOptions" string text = "This is my string"; string[] words = text .Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries); TotalWords = words.Length; is anybody knows how to deal wit hthe problem ? eyalso

        A Offline
        A Offline
        alexey N
        wrote on last edited by
        #3

        It's only in framework 2.0 Namespace: System Assembly: mscorlib (in mscorlib.dll) Best regards, Alexey.

        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