c# - String Needs to Contain 2 words -
i have textbox on 1 of views, , textbox should not accept has more 2 words or less 2 words. textbox needs 2 words. basically textbox accepts person's first , last name. don't want people enter 1 or other. is there way check space character between 2 words , space character along letter , number , etc after 2nd word if exists? think if user accidently 'fat-fingers' space after 2nd word, should fine bc there still 2 words. for example: /* _ character means space */ john /* not accepted */ john_ /* not accepted */ john_smith_a /* not accepted */ john smith_ /* accepted */ any appreciated. there multiple approaches use solve this, i'll review on few. using string.split() method you use string.split() method break string it's individual components based on delimiter. in case, use space delimiter individual words : // words, removing empty entries along way var words = yourtextbox.split(n...