lundi 9 mai 2016

Getting substring value in Chef ruby

I have a string that has the following value:

ucp-1.1.0_dtr-2.0.0

I am trying to fetch only 1.1.0 from the string. I am using the following code but it doesn't seem to work

substring = ucp-1.1.0_dtr-2.0.0.gsub('ucp-','')

Aucun commentaire:

Enregistrer un commentaire