Link to home
Start Free TrialLog in
Avatar of Seven price
Seven priceFlag for United States of America

asked on

Index was outside the bounds of the array. TextChanged

        initials = New String(word.Split(" "c).Select(Function(f) f(0)).ToArray).ToUpper()

Open in new window

 For Each ch As Char In word
            
                If Not Char.IsWhiteSpace(ch) Then
                    intCount += 1
               
            End If

Open in new window

I am using function TextChanged, this problem works with a button but when typeing the text when I get to a space I get and error from initials
Index was outside the bounds of the array.
with my above example how can this be fixed.
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Seven price

ASKER

Great, thanks