Mega Code Archive
Categories
/
Ruby
/
String
Line[line index(k)]
line = "A horse! a horse! my kingdom for a horse!" line[line.index("k")] # => 107 line[line.index("k")].chr # => "k"