string[] words = {"januar", "februar", "marec", "april", "maj", "junij", "julij",
"avgust", "september", "oktober", "november", "december"};
I have word "ja" for example or "dec". How can I get "januar" or "december" from an array of string? Is there any fast solution?
Thanks.
You can use LINQ:
words.FirstOrDefault(w => w.StartsWith(str, StringComparison.OrdinalIgnoreCase))
If there was no match, this will return null
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With