Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby substring

value = "lovelace"

# Get substring at index 1 with length 3.
# ... First argument is start index, second is length.
last_three = value[0,3]
puts last_three
#outputs "love"
 
PREVIOUS NEXT
Tagged: #ruby #substring
ADD COMMENT
Topic
Name
3+5 =