troubleshooting Question

C♯ method TimStart() method

Avatar of Darius
DariusFlag for Lithuania asked on
18 Comments1 Solution128 ViewsLast Modified:
Hi guys,
I working on pretty old project from 2010 (.net framework 4)
 I need to validate entries of string value:
1. Take it off leading and trailing empty space from input string.
2. Leading 'zeros' from input string and after length should be not greater then 10.

strValue = "  0001234567890 "

strValue = strValue.Trim()
str = stringValue.TrimStart('0')
if(str.length> 10) {
...popup message

Problem this:
method Trim()            => works
method TrimStart()    => error: Object doesn't support property or method 'TrimStart'

Any ideas?
Thank You
Join our community to see this answer!
Unlock 1 Answer and 18 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 18 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros