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

๐Ÿ“– Read the articleOpen in YouTube