I want to split the string "hello+world-apple+francisco-rome"into ["hello", "+world", "-apple", "+francisco", "-rome"].
"hello+world-apple+francisco-rome"
["hello", "+world", "-apple", "+francisco", "-rome"]
String::splitactually loses the cleavage element. Can anyone do this?
String::split
You can do this with this simple regular expression:
"hello+world-apple+francisco-rome".scan(/[+\-]?\w+/)
Source: https://habr.com/ru/post/1757262/More articles:How practical is the iPad for enterprise applications? - ipadCan someone tell me a good Vi (or Vim) application for windows? - vimNSFetchedResultsChangeDelete not starting - iphoneTemplate procedure abandoned local class functions - c ++What does the raw CFI 0:50 instruction mean? - valgrindSQL query: Get the average value and the average value of everything above a certain value, in the same query - sqlWhat are some tips for writing good CSS? - cssNesting layout information in standard template values - sitecorehttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1757266/problem-with-repository-pattern-abstract-classes&usg=ALkJrhhMU2gad3E9IbrFgywuf5lXEp91SQAllowPartiallyTrustedCallersAttribute error with MVC 2 and .NET 4.0 - securityAll Articles