String slicing and indexing
📖 Scenario: You work at a bookstore that keeps book titles in a list. You want to extract parts of these titles to create short labels.
🎯 Goal: Learn how to slice and index strings in Ruby to get parts of book titles.
📋 What You'll Learn
Create a string variable with a book title
Create a variable for the start index
Use string slicing to get a substring
Print the sliced substring
💡 Why This Matters
🌍 Real World
Extracting parts of strings is useful when creating labels, previews, or summaries from longer text.
💼 Career
String slicing is a basic skill needed in many programming jobs, including web development, data processing, and automation.
Progress0 / 4 steps