Golang String EqualFold() function

EqualFold() function in the Golang strings package is used to check if two strings are equal. It returns a true value if two strings are equal else false. Here strings are interpreted as UTF-8 strings and comparison is performed under Unicode case-folding. The string comparison using the EqualFold() function is not case-sensitive. EqualFold() Syntax The …

Read more

Golang String ContainsRune()

ContainsRune() Function in Golang strings package is used to check the given string contains the specified rune in it or not. It returns true if the Unicode code point r in rune are present in the given string else returns false. ContainsRune() Syntax The syntax for ContainsRune() function is: ContainsRune() Parameters: The ContainsRune() function take …

Read more

Golang String ContainsAny

Golang strings package ContainsAny() is a built-in function used to check if the given Unicode characters are present in the string. It returns true if the characters in the second argument in ContainsAny() function is present in the given string else returns false. ContainsAny() method is different from string.Contains() method as it returns true if …

Read more

Golang String Contains

Golang strings package Contains() is a built-in function is used to check if a string contains the substring in go. It returns true if a substring is within the string else returns false. Contains() Syntax The syntax for Contains() function is: Contains() Parameters: The Contains() function take two parameters s1- string substr- string Contains() Return …

Read more