Ruby is an open source object-oriented programming server-side scripting language that was designed and developed by Japan's Yukihiro Matsumoto (Yukihiro Matsumoto) in the mid 1990s. In the Ruby community, Matsumoto is also called Matz. Ruby can run on multiple platforms, such as various versions of Windows, MAC OS and UNIX
Who should read this tutorial?
This tutorial helps beginners understand the basics and basic concepts of the Ruby language
Compile / execute Ruby program
For most programming languages, the first entry example is "Hello World!". The following example uses Ruby to output "Hello World!"
# ! / usr / bin / ruby puts " Hello World! " ;
Ruby Topics with examples
A String object in Ruby holds and manipulates an arbitrary sequence of one or more bytes, typically representing characters that represent human language.
The simplest string literals are enclosed in single quotes (the apostrophe character). The text within the quote marks is the value of the string
'This is a simple Ruby string literal'
If you need to place an apostrophe within a single-quoted string literal, precede it with a backslash, so that the Ruby interpreter does not think that it terminates the string
'Won\'t you read O\'Reilly\'s book?'
The backslash also works to escape another backslash, so that the second backslash is not itself interpreted as an escape character.
Following are the string-related features of Ruby
- Expression Substitution
- General Delimited Strings
- Escape Characters
- Character Encoding
Ruby Program to Reverse a String in ruby
Some ruby Unbundled series