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 | Range inspect() function
- Ruby | Rational inspect() function
- Ruby | Hash inspect() function
- Ruby | Symbol inspect function
- Ruby | StringScanner inspect function
- Ruby | BigDecimal class inspect value
- Ruby | Regexp inspect() function
- Ruby | Struct inspect() function
- Ruby | Array class inspect() function
- Ruby | String eql? Method
- Ruby | String === Method
- Ruby | String hex 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 firstname.lastname@example.org. 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.