method
try_convert
v1_9_1_378 -
Show latest stable
- Class:
String
try_convert(p1)public
Try to convert obj into a String, using to_str method. Returns converted regexp or nil if obj cannot be converted for any reason.
String.try_convert("str") # => str String.try_convert(/re/) # => nil