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

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -