Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (26 sloc) 1.01 KB
Name Parse
Copyright (c) 2009 The Rubyists (Jayson Vaughn, Tj Vanderpoel, Michael Fellinger, Kevin Berry)
Distributed under the terms of the MIT License.
A ruby library for turning arbitrary name strings such as "Dr Helen Hunt", "Mr James T. Kirk" into a
standardized object usable as
parsed ="Dr Helen Hunt")
puts "%s %s" % [parsed.first, parsed.last]
- ruby (>= 1.8)
Example of using on a list:
bougyman@zero:~/git_checkouts/name_parse$ irb -r lib/name_parse
irb(main):001:0> list = ["Jayson Vaughn", "Dr Helen Hunt", "Mr James T. Kirk"]
=> ["Jayson Vaughn", "Dr Helen Hunt", "Mr James T. Kirk"]
irb(main):002:0> { |n| p = NameParse[n]; [p.first, p.last] }
=> [["Jayson", "Vaughn"], ["Helen", "Hunt"], ["James", "Kirk"]]
Home page at
#rubyists on FreeNode