How do I split a string with two different delimiters in Ruby and convert it to two arrays?

I have a string

"Param 1: 1, Some text: 2, Example3: 3, Example4: 4"

and I'd like to convert it into an arrays:

["Param 1","Some text","Example3","Example4"]
[1,2,3,4]

How?



from Recent Questions - Stack Overflow https://ift.tt/3JtO1pc
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation