scriban / scriban

A fast, powerful, safe and lightweight scripting language and engine for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

case-insensitive comparison of string?

joshidp opened this issue · comments

How can we do case-insensitive of string? I am trying below snippet but its doing case sensitive comparison.

{{valueA!=valueB}}

Thanks

I think it's possible and reasonable to make the built-in function making case-insensitive comparison.

For now, you can use this workaround:
a_string.downcase == b_string.downcase
or
a_string.upcase == b_string.upcase

How can we do case-insensitive of string?

@joshidp You do not need to use workaround I have written in this thread. Builtin string.equals_ignore_case is added to the newest version. Try it yourself!