This is a migrated thread and some comments may be shown as answers.

Remove Leading zeroes from IP masked input

1 Answer 42 Views
Input
This is a migrated thread and some comments may be shown as answers.
Hadar Kaufman
Top achievements
Rank 1
Hadar Kaufman asked on 17 Feb 2009, 01:15 PM
is there a way to save this IP:
192.095.013.001
like this:
192.95.13.1
?
i'm using RadMaskedTextBox  with Mask="<0..255>.<0..255>.<0..255>.<0..255>"

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 17 Feb 2009, 02:10 PM
Hello Hadar,

You can strip the leading zeroes using a similar approach:
string[] arr = radMask1.TextWithLiterals.Split('.'); 
for(int i = 0; i < arr.Length; i++) 
    arr[i] = arr[i].TrimStart('0'); 

Hope this helps.

Kind regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Input
Asked by
Hadar Kaufman
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or