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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user