PHP to Ruby
Convert PHP code into Ruby!
-
is_string
Posted on August 12th, 2009 No commentsThe is_string() function allows you to check if a particular variable is a string (type).
PHP
$string1 = 'Hello World'; var_dump( is_string($string1) ); // => true
Ruby
string1 = 'Hello World'; puts string1.is_a?(String); # => true
Leave a reply


