Go Trim()

1 개요[ | ]

Go Trim()
package main

import (
	"fmt"
	"strings"
)

func main() {
	fmt.Print(strings.Trim("¡¡¡Hello, Gophers!!!", "!¡"))
}
package main

import (
    "fmt"
    "strings"
)

func main() {
    str := "  HELLO  ";
    trimmed := strings.Trim(str," ");
    fmt.Println("["+str+"]");
    fmt.Println("["+trimmed+"]");
}
package main

import (
    "fmt"
    "strings"
)

func main() {
    str := `    HELLO  
WORLD
`;
    trimmed := strings.Trim(str," \t\n");
    fmt.Println("["+str+"]");
    fmt.Println("["+trimmed+"]");
}

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}