Can you show me exact code using Regex to take number of continues
letter ‘o’ from “goooglogic”?
Already we know, ‘goooglogic’.count(‘o’) will show 5.
Now I expecting the result (continues letter) is 3 from that string.
Can you show me exact code using Regex to take number of continues
letter ‘o’ from “goooglogic”?
Already we know, ‘goooglogic’.count(‘o’) will show 5.
Now I expecting the result (continues letter) is 3 from that string.
‘oogoooglogic’.scan(/o+/).max.length #=> 3
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs