Strings & Formatting (Printf, strings Package, Slicing) - Go Tutorial for Beginners #3

6views
00
4:35
T
Taught by Celeste AI - AI Coding Coach
View on YouTube
Description
Learn how to work with strings and formatting in Go! šŸ“ In this lesson, you will learn: āœ… String literals and raw strings āœ… String concatenation with + āœ… Printf format verbs (%s, %d, %f, %v, %T) āœ… The strings package (ToUpper, ToLower, Split, Join) āœ… String indexing and slicing šŸ• Timestamps: 0:00 - Introduction 0:24 - String Basics & Concatenation 1:03 - Printf Formatting 1:42 - strings Package 2:27 - String Indexing & Slicing 3:09 - Recap 3:39 - End šŸ’» Source Code: https://github.com/GoCelesteAI/go_strings šŸ“š Code from this lesson: // String concatenation greeting := "Hello" name := "World" message := greeting + ", " + name + "!" // Printf formatting fmt.Printf("Name: %s\n", name) fmt.Printf("Age: %d years\n", age) fmt.Printf("Price: $%.2f\n", price) fmt.Printf("Type: %T, Value: %v\n", age, age) // strings package strings.ToUpper("hello") // "HELLO" strings.TrimSpace(" hi ") // "hi" strings.Split("a,b,c", ",") // ["a", "b", "c"] strings.Join(slice, "-") // "a-b-c" // String slicing word := "Golang" word[0] // 'G' (first character) word[:2] // "Go" (first 2) word[2:] // "lang" (from index 2) word[1:5] // "olan" (middle portion) šŸ”— Previous: Lesson 2 - Variables & Types šŸ”— Next: Lesson 4 - Numbers & Math #Go #Golang #GoTutorial #LearnGo #Programming #Strings #Printf #Formatting #GoProgramming
Back to tutorials

Duration

4:35

Published

January 25, 2026

Added to Codegiz

March 15, 2026

Open in YouTube