I have the following string.
melody = "F# G# A# B |A# G# F# |A# B C# D# |C# B A# |F# F#
|F# F# |F#F#G#G#A#A#BB|A# G# F# "
I want to convert F# to f, G# to g etc.
melody.gsub(/C#/, 'c').gsub(/D#/,'d').gsub(/F#/,'f').gsub(/G#/,'g').gsub(/A#/,'a')
The above gives a desired output. But I am wondering if I can use gsub only once.
"f g a B |a g f |a B c d |c B a |f f |f f |ffggaaBB|a g f "