Similar Collections


In Ruby, a String object has an arbitrary sequence of bytes, typically representing text or binary data. A String object may be created using String::new or as literals.

This section contains Ruby strings programs, practice these Ruby programs to learn the concept of Ruby strings, these programs contain the solved code, outputs, and the detailed explanation of the statements, functions used in the Ruby strings programs.

questions

Title
Ruby program to convert a string into lowercase
Ruby program to trim a string from both sides
Ruby program to trim a string from the left side
Ruby program to trim a string from the right side
Ruby program to check a string starts with a specified substring
Ruby program to check a string end with a specified substring
Ruby program to delete suffix substring from the given string
Ruby program to delete prefix substring from the given string
Ruby program to convert the string into an array of characters
Ruby program to convert the string into an array of characters based on the specified character
Ruby program to convert the array of characters into the string
Ruby program to convert an integer array into a string
Ruby program to convert a numeric string into integer using to_i() function
Ruby program to check a string is a numeric string or not using the match() function
Ruby program to concatenate the strings using the << operator
Ruby program to iterate characters using the each_char() function
Ruby program to convert the string into an array of characters using chars() function
Ruby program to create a multi-line string using \'%Q\'
Ruby program to replace text inside the string using gsub() method
Ruby program to remove a specified character inside the string using gsub() method
total questions: 44

Questions

44

Views

516

Best Answers

299

Points

5