https://github.com/codeupjewell/ruby-string-demo
Ruby string practice
https://github.com/codeupjewell/ruby-string-demo
methods practice-project ruby string syntax
Last synced: about 1 year ago
JSON representation
Ruby string practice
- Host: GitHub
- URL: https://github.com/codeupjewell/ruby-string-demo
- Owner: CodeUpJewell
- Created: 2023-03-05T21:23:59.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-05T21:25:03.000Z (about 3 years ago)
- Last Synced: 2025-01-21T18:49:21.184Z (over 1 year ago)
- Topics: methods, practice-project, ruby, string, syntax
- Language: Dockerfile
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ruby Practice
Run your Ruby file by typing `ruby ` and then the name of the file you want to run in the Terminal.
If we want to run `string_multiplication.rb`, we can write the command:
```bash
ruby string_multiplication.rb
```
To re-run this command, you can use the UP and DOWN arrow keys to look at the history of commands you've run in a Terminal.
## String
### string_multiplication.rb
Should output:
```
"HoHoHo"
```
using String multiplication.
(Don't just print the String literal `"HoHoHo"`)
### string_case.rb
Should output:
```
"HELLO friends AnD FaMiLy"
```
using a combination of the `upcase`, `downcase`, and `swapcase` methods.
### string_chomp.rb
Shoud output:
```
"Hello!"
```
using the given starting variable.
### string_gsub.rb
Should output:
```
"put spaces in between these words"
```
using the given starting variable.
### string_strip.rb
Should output exactly
```
"remove the outside spaces"
```
using the given starting variable.
### string_gets.rb
Write a program that gets a name (e.g. "alice") from the user, capitalizes it, and then says "Hello, Alice!"
Should work similarly to the following:
```
"What's your name?"
jelani
"Hello, Jelani!"
```
## Specs
Click here to see names of each test
string_multiplication.rb should output 'HoHoHo' using String multiplication
string_strip.rb should output 'remove outside spaces'
string_case.rb should output 'HELLO friends AnD FaMiLy'
string_gsub.rb should output 'put spaces in between these words'
string_chomp.rb should remove ending '$'
string_gets.rb should output 'Hello, name!'