1 Replies - 487 Views - Last Post: 08 October 2012 - 09:40 PM Rate Topic: -----

#1 lilVaratep  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 26
  • View blog
  • Posts: 237
  • Joined: 09-October 11

How to string split() exact match

Posted 08 October 2012 - 09:31 PM

I want to cut out exactly " - ", but my delims = "[ \\- ]" is splitting at every space as well. is there a way to make it so it only splits when it sees: " - " exactly ??

nevermind i'm stupid. need to take out brackers for exact match.

This post has been edited by lilVaratep: 08 October 2012 - 09:37 PM

Is This A Good Question/Topic? 1
  • +

Replies To: How to string split() exact match

#2 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7996
  • View blog
  • Posts: 13,694
  • Joined: 19-March 11

Re: How to string split() exact match

Posted 08 October 2012 - 09:40 PM

A regular expression in brackets matches on each of the possibilities listed in the brackets.

[abc] matches when it finds an 'a', a 'b', or a 'c'. Splitting on the String " \\- " should work.



EDIT: Oh, look, ninja'd by the OP. Well done.

This post has been edited by jon.kiparsky: 08 October 2012 - 10:46 PM

Was This Post Helpful? 2
  • +
  • -

Page 1 of 1