Skip to content

Instantly share code, notes, and snippets.

@senilegenius
Created July 17, 2012 15:27
Show Gist options
  • Save senilegenius/3130090 to your computer and use it in GitHub Desktop.
Save senilegenius/3130090 to your computer and use it in GitHub Desktop.
printing everything after last '.'
irb(main):026:0> string = "1.2.3.4.532432423"
=> "1.2.3.4.532432423"
irb(main):027:0> substring = string.gsub /.*\.$*/, ''
=> "532432423"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment