str is the string whose length is to be computed in this case.
Returns:It will return the str's character length.
The built-in length method in Ruby is the simplest way to get the length of a string. The length of the characters in the provided string is returned. The characters in the string, including whitespace characters, will be returned by the procedure.
Share a personalized message with your friends.