Skip to content

Instantly share code, notes, and snippets.

@jvnill
Created March 1, 2013 07:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jvnill/5063030 to your computer and use it in GitHub Desktop.
Save jvnill/5063030 to your computer and use it in GitHub Desktop.
>> str="D:\\projects\\curator\\java\\hpc"
=> "D:\\projects\\curator\\java\\hpc"
>> no=str.count("\\")
=> 4
>> splitstr=str.split(pattern="\\",no+1)
=> ["D:", "projects", "curator", "java", "hpc"]
>> splitstr.length
=> 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment