SyntaxFix
Write A Post
Hire A Developer
Questions
If you don't need the leading and trailing spaces :
str.Trim().Length