Removed `String#try_convert` method from `mruby-string-ext` gem.
Because `try_convert` method rarely used in production. For mruby users,
we have `__to_str` utility method to check string type.
MODIFY
mrbgems/mruby-string-ext/mrblib/string.rb
mrbgems/mruby-string-ext/mrblib/string.rb
class String
- ##
- # call-seq:
- # String.try_convert(obj) -> string or nil
- #
- # Try to convert <i>obj</i> into a String, using to_str method.
- # Returns converted string or nil if <i>obj</i> cannot be converted
- # for any reason.
- #
- # String.try_convert("str") #=> "str"
- # String.try_convert(/re/) #=> nil
- #
- def self.try_convert(obj)
- if self === obj
- obj
- else
- nil
- end
- end
-
##
# call-seq:
# string.clear -> string

MODIFY
mrbgems/mruby-string-ext/test/string.rb
mrbgems/mruby-string-ext/test/string.rb
UTF8STRING = ("\343\201\202".size == 1)
-assert('String.try_convert') do
- assert_nil String.try_convert(nil)
- assert_nil String.try_convert(:foo)
- assert_equal "", String.try_convert("")
- assert_equal "1,2,3", String.try_convert("1,2,3")
-end
-
assert('String#getbyte') do
str1 = "hello"
bytes1 = [104, 101, 108, 108, 111]

Removed `String#try_convert` method from `mruby-string-ext` gem.

Because `try_convert` method rarely used in production. For mruby users,
we have `__to_str` utility method to check string type.