We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
strings.TrimRight的作用是把有包含第二个参数的组合项的对应字母都替换掉,比如"BA"的组合集合为{"BA", "AB", "A", "B"}; 但是它有一个中止条件,如果从右到左有一个字母或字母组合不为"BA"的排列组合集合中的元素,便会停止cut,把当前已cut完的字符串返回 测试代码如下:
import ( "fmt" "strings" ) func main() { var f = func(example, cutset string) { result := strings.TrimRight(example, cutset) fmt.Println(result == "") fmt.Printf("example : %s, cutset : %s, result : %s\n", example, cutset, result) } f("ABBA", "BA") f("ABCBA", "BA") } ############################### Output: true example : ABBA, cutset : BA, result : false example : ABCBA, cutset : BA, result : ABC
The text was updated successfully, but these errors were encountered:
有點像bug...
Sorry, something went wrong.
No branches or pull requests
输出结果为""
strings.TrimRight的作用是把有包含第二个参数的组合项的对应字母都替换掉,比如"BA"的组合集合为{"BA", "AB", "A", "B"};
但是它有一个中止条件,如果从右到左有一个字母或字母组合不为"BA"的排列组合集合中的元素,便会停止cut,把当前已cut完的字符串返回
测试代码如下:
The text was updated successfully, but these errors were encountered: