Home
Ruby
ActiveRecord
Array
CGI
Class
Collections
Database
Date
Design Patterns
Development
File Directory
GUI
Hash
Language Basics
Method
Network
Number
Rails
Range
Reflection
Statement
String
Threads
Time
Tk
Unit Test
Windows Platform
XML
Menu
String range with string.length : String Range « String « Ruby
Ruby
String
String Range
String range with string.length
s =
'My kingdom for a string!'
s[15...s.length] # =>
"a string!"
Related examples in the same category
1.
enter a string as the argument to []=, and it will return the new, corrected string, if found; nil otherwise.
2.
enter a range to indicate a range of characters you want to change. Include the last character with two dots (..)
3.
Get substring from a string object
4.
Getting the Parts of a String You Want
5.
Generating a Succession of Strings
6.
Change a string with range