package main

import (
	"fmt"
	"path/filepath"
	"strings"
)

func main() {
	file := "Holiday-2027.JPG"
	fmt.Println("length:", len(file))
	fmt.Println("first 7:", file[:7])
	fmt.Println("the dash is at", strings.Index(file, "-"))
	fmt.Println("small letters:", strings.ToLower(file))
	fmt.Println("ending:", filepath.Ext(file))
	fmt.Println("new ending:", strings.TrimSuffix(file, ".JPG")+".txt")
	fmt.Println("parts:", strings.Split("3,Example HDD B,12000", ","))

	// len counts bytes; a range over the text gives whole letters
	word := "żółw"
	letters := 0
	for range word {
		letters++
	}
	fmt.Println(len(word), "bytes,", letters, "letters")
}
