1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 21:02:27 +08:00

feat: add HideString

This commit is contained in:
dudaodong
2023-05-23 18:39:59 +08:00
parent b1fcfce188
commit e149ae2f72
5 changed files with 146 additions and 1 deletions

View File

@@ -571,3 +571,23 @@ func ExampleSplitAndTrim() {
// [a b c d $1]
// [a b c d 1]
}
func ExampleHideString() {
str := "13242658976"
result1 := HideString(str, 3, 3, "*")
result2 := HideString(str, 3, 4, "*")
result3 := HideString(str, 3, 7, "*")
result4 := HideString(str, 7, 11, "*")
fmt.Println(result1)
fmt.Println(result2)
fmt.Println(result3)
fmt.Println(result4)
// Output:
// 13242658976
// 132*2658976
// 132****8976
// 1324265****
}