ruby - Isolating/removing Characters from string using rails -



ruby - Isolating/removing Characters from string using rails -

i using ruby on rails

i have

article.id = 509969989168q000475601

i output

article.id = 68q000475601

basically want rid of before gets 68q

the numbers in front end of 68q can various length there way remove "68q"

it 68q , q letter there way remove characters 2 digits before "q"

i'd use:

article.id[/68q.*/]

which homecoming 68q end of string.

ruby-on-rails ruby

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

ubuntu - Bash Script to Check That Files Are Being Created -