Ruby Learning # 8 Working With String

When outputting ", backslash
Option + ¥ mark on mac 8 Working With String puts "Giraffe" Academy" # Giraffe" Academy

phrase = "Giraffe Academy" puts phrase #Giraffe Academy
puts.upcase() #GIRAFFE ACADEMY puts.downcase() #giraffe academy phrase = " Giraffe Academy " puts phrase.strip() #Giraffe Academy

Space can be taken

puts.phrase.length() #15 puts phrase.include? "Academy" #true puts phrase.include? "Academys" #false puts phrase[0] #G puts phrase[3] #a puts phrase[0,3] #Gir puts phrase.index(G) #0 puts phrase.index(ffe) #4 puts "programming".upcase() #PROGRAMMING

Recommended Posts

Ruby Learning # 8 Working With String
Ruby learning 4
Ruby learning 5
Ruby learning 3
Ruby learning 2
Ruby learning 6
Ruby learning 1
Learning Ruby with AtCoder 6 [Contest 168 Therefore]
Ruby Learning # 25 Comments
Ruby Learning # 13 Arrays
Ruby Learning # 1 Introduction
Ruby Learning # 34 Modules
Learning Ruby with AtCoder 7 [Contest 168 Triple Dots]
Ruby Learning # 14 Hashes
Ruby Learning # 33 Inheritance
Extract a part of a string with Ruby
Ruby Learning # 15 Methods
Install Ruby 3.0.0 with asdf
Ruby learning points (basic)
Ruby Learning # 20 Case Expressions
Ruby Learning # 24 Exponent Method
Ruby Learning # 17 If Statements
Ruby Learning # 21 While Loops
Ruby Learning # 31 Object Methods
Getting Started with Ruby
Ruby Learning # 27 Writing Files
[Rails] Learning with Rails tutorial
Ruby Learning # 35 Interactive Ruby (irb)
Ruby Learning # 9 Math & Numbers
Ruby Learning # 28 Handling Errors
Ruby Learning # 26 Reading Files
11th, Classification with Ruby
Ruby Learning # 23 For Loops
Ruby Learning # 16 Return Statement
Evolve Eevee with Ruby
Various Ruby string operations
Ruby Learning # 2 Drawing a Shape
Ruby on rails learning record -2020.10.03
Ruby version switching with rbenv
Solve Google problems with Ruby
I tried DI with Ruby
GraphQL Client starting with Ruby
Ruby on rails learning record -2020.10.04
Ruby on rails learning record -2020.10.05
Ruby on rails learning record -2020.10.09
Ruby Learning # 18 If Statements (Con't)
Convert to Ruby Leet string
Ruby: Send email with Starttls
Leap year judgment with Ruby
Learning Ruby with AtCoder 10 [1st Algorithm Practical Test DoubleCamelCase Sort]
Ruby on Rails basic learning ①
Format Ruby with VS Code
Integer check method with ruby
Ruby Learning # 11 Building a Calculator
Ruby Learning # 99 Personal Programming Notebook
Ruby on rails learning record-2020.10.07 ②
Learning Ruby with AtCoder 13 How to make a two-dimensional array
Ruby Learning # 10 Getting User Input
Ruby Learning # 32 Building a Quiz
Ruby on rails learning record-2020.10.07 ①
Extract a string starting with a capital letter with a regular expression (Ruby)