Hey folks! đź‘‹
So, I’ve been messing around with strings in Go and stumbled upon this thing called *golang string fold contains*. Basically, I need to check if a string contains another string but in a case-insensitive way. Like, "hello" should match "HELLO" or "HeLlO".
I tried using `strings.Contains`, but it’s case-sensitive, so that’s a no-go. Then I heard about `strings.EqualFold`, but that only checks if two strings are equal, not if one’s a substring of the other.
Anyone got tips on how to implement *golang string fold contains* properly? Like, is there a clean way to do this without writing a ton of extra code? Or am I overcomplicating it?
Thanks in advance! 🙏
So, I’ve been messing around with strings in Go and stumbled upon this thing called *golang string fold contains*. Basically, I need to check if a string contains another string but in a case-insensitive way. Like, "hello" should match "HELLO" or "HeLlO".
I tried using `strings.Contains`, but it’s case-sensitive, so that’s a no-go. Then I heard about `strings.EqualFold`, but that only checks if two strings are equal, not if one’s a substring of the other.
Anyone got tips on how to implement *golang string fold contains* properly? Like, is there a clean way to do this without writing a ton of extra code? Or am I overcomplicating it?
Thanks in advance! 🙏
