Skip to content

Commit

Permalink
Merge pull request #2695 from kodenook/develop
Browse files Browse the repository at this point in the history
Reto #4 - go
  • Loading branch information
kontroldev authored Apr 5, 2024
2 parents 7391844 + 31d882f commit 43c050a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Roadmap/04 - CADENAS DE CARACTERES/go/kodenook.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package main

import (
"fmt"
"strings"
)

func main() {
/*
String Functions
*/

var word string = "hello, Go"

fmt.Println(strings.Contains(word, "hello"))
fmt.Println(strings.Count(word, "l"))
fmt.Println(strings.Index(word, "Go"))
fmt.Println(strings.LastIndex(word, "Go"))
fmt.Println(strings.Repeat(word, 2))
fmt.Println(strings.Replace(word, "Go", "Go!", 1))
fmt.Println(strings.ToLower(word))
fmt.Println(strings.ToUpper(word))
fmt.Println(strings.Trim(word, "eho"))
fmt.Println(strings.TrimSpace(word))
}

0 comments on commit 43c050a

Please sign in to comment.