Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

Iterate over characters of a string in Ruby String

input = 'abcdef'

chars = input.split('')
puts chars.length
puts chars[2]
puts


chars.each { |c|
    puts c
}
Source by code-maven.com #
 
PREVIOUS NEXT
Tagged: #Iterate #characters #string #Ruby #String
ADD COMMENT
Topic
Name
1+2 =