Feat: Implement hasValue
I am new to zig and was looking into strings. Ran accross this project and though it was cool and thought I could contribute something. Let me know if I am doing something wrong and I will fix it. Thanks.
Looking at the new function, the code looks fine, but I'm having a hard time understanding its use purpose. Could you provide an explanation for the function and where it might be used?
Where I tend to find and use functions like these is if I am getting a string from another source I do not have control over (third party api or whatever) and maybe that string is just white space or an empty string. In many scenarios that is not useful and can be ignored in future processing. So, for example, if I were inserting strings into a database and I only want a string I consider to have value (no strings that just consist of white space or whatever characters I deem to have no value). Its nice to have a function to call that answers the question is this string value useful to me.
With all that said, if you deem it not useful to this project or have no need for it, I fully understand not accepting the code. I was just messing around / learning zig, found this project, and thought this function could be potentially useful. Thanks.
I see the use case for the function but I think its an uncommon string library function. There could be something you could implement though, which is similar. We are missing an includes function if you are still interested in contributing to the project.
Sure I can give it a go. Just so we are clear on what includes does, I am assuming it takes a string and checks that it is included/inside the source string? You can close this PR then if this hasValue does not belong. Thanks.
Yes that's right! I will close this PR now, thank you!