How to find alphabet irrespective of upper or lower

I have fruits name like {Apple,orange,kiwi,lemon}, so my condition is like to find fruits which start with “k” and exit from condition but here i need to involve a condition like bot should find fruits which starts with “k” irrespective of upper or lower case how to get this

Thanks in advance.

Consider you have stored the fruit name in a variable fruitName
While checking for the first letter, you can convert it to upper or lower case and check for the first letter in the corresponding case. Like this :

1 Like

Is your fruit names are stored in an array and you want to fetch all the fruitnames starting from K or k?

i am storing all names in an array and need fruit names which doesn’t start with k.

My bad, I ignored the array part of your problem :smiley:

You can loop through the array using For each loop. Something like this :

For Each fruitName in fruitsArray
If not fruitName.ToUpper.StartsWith("K")
then Writeline fruitName
Else (leave this blank as you want to ignore fruit names starting with K or k)

Hope this helps

1 Like

arrayOfFruitNames.where(function(x) x.ToLower.StartsWith(“k”)).toArray()

The output will be an array of fruit names starting with k or K