1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-07 14:12:28 +08:00

feat: add Rotate for string

This commit is contained in:
dudaodong
2024-09-03 16:35:38 +08:00
parent 63216d9b1c
commit 601df5dc12
5 changed files with 152 additions and 15 deletions

View File

@@ -709,3 +709,18 @@ func ExampleEllipsis() {
// 你好...
// 😀😃😄...
}
func ExampleRotate() {
result1 := Rotate("Hello", 0)
result2 := Rotate("Hello", 1)
result3 := Rotate("Hello", 2)
fmt.Println(result1)
fmt.Println(result2)
fmt.Println(result3)
// Output:
// Hello
// oHell
// loHel
}