inspect is a String class method in Ruby which is used to return a printable version of the given string, surrounded by quote marks, with special characters escaped.
Returns: Here, str is the given string.
"Ru \n y" "Ar\b\\bcles"
- Ruby | Time inspect function
- Ruby | Hash inspect() function
- Ruby | Range inspect() function
- Ruby | Symbol inspect function
- Ruby | Regexp inspect() function
- Ruby | Rational inspect() function
- Ruby | Struct inspect() function
- Ruby | BigDecimal class inspect value
- Ruby | StringScanner inspect function
- Ruby | Array class inspect() function
- Ruby | String === Method
- Ruby | String == method
- Ruby | String << Method
- Ruby | String <=> Method
- Ruby | String chr Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.