I have a string as
"The Fashion Project - The Project of Fashion-Technology and Science-institute"
I need to extract the strings as project name and its description so that it returns an array . So the output should be
array[0] = "The Fashion Project"
array[1] = "The Project of Fashion-Technology and Science-institute"
I tried it with split method but the array[1] returned "The Project of Fashion" I tried it as
"The Fashion Project - The Project of Fashion-Technology and Science-institute".split('-')
You can try this also
2.1.2 :007 > s = "The Fashion Project - The Project of Fashion-Technology and Science-institute"
=> "The Fashion Project - The Project of Fashion-Technology and Science-institute"
2.1.2 :008 > s.split(/\s[-\b]\s/)
=> ["The Fashion Project", "The Project of Fashion-Technology and Science-institute"]
2.1.2 :009 >
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments