I want to play a little with the Textbox. How do I count the items of a textbox?
Example: The first line contains the characters: 2 4 6 8
, so there are 4 characters. How do I display this count in another textbox?
Hope this will help,
var nonSpaceCharCount = inputText.Count(c => !Char.IsWhiteSpace(c));
var letterOrDigitCount = inputText.Count(c => Char.IsLetterOrDigit(c));
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.