String.try_convert(obj) â string or nil
Class Public methods
Try to convert obj into a String, using #to_str method. Returns converted string or nil if obj cannot be converted for any reason.
1 2 | String .try_convert( "str" ) #=> "str" String .try_convert(/re/) #=> nil |
Please login to continue.