i have a array like below.
I have to sort this array depends on the prefix(nymber)Code:Dim sTemp() as string={"CCC1", "CCCs10", "CCCx11", "CsCC2", "CffffCC3"}
any help pls...Code:sTemp() ={"CCC1", "CsCC2", "CffffCC3", "CCCs10", "CCCx11"}
Printable View
i have a array like below.
I have to sort this array depends on the prefix(nymber)Code:Dim sTemp() as string={"CCC1", "CCCs10", "CCCx11", "CsCC2", "CffffCC3"}
any help pls...Code:sTemp() ={"CCC1", "CsCC2", "CffffCC3", "CCCs10", "CCCx11"}
look at the array.sort method
Array.Sort returning the same as input..
If you want it to sort on the number, and not on the rest of the text, you can create your own comparer.
There's an excellent explanation + example at jmcilhinney's blog:
http://jmcilhinney.blogspot.com/2009...ns-part-1.html