Cyber Axe Posted July 4, 2005 Share Posted July 4, 2005 (edited) i have an array of strings and what i want to do is remove any array strings that have a length of 0 or = "" / nothing / null but i cant figure out how to do thisthe other thing i want to do is a smarter array sorting method that sorts numbers01234678910instead of01101112220213and so on anyone know where i could find info on this type of sorting or have the appropriate code to do so? ive been googling for ages with no luck Edited July 4, 2005 by Cyber Axe Link to comment Share on other sites More sharing options...
dman Posted July 4, 2005 Share Posted July 4, 2005 (edited) Hi Cyber,I caught your post before you edited it. I think you are looking in the wrong place to remove blank lines. instead of removing them from the array, let the sort function bring them to the top and use the trim method after rejoining the string, like this.frmNotepad.txtNotepad.Text = String.Join(Environment.NewLine, sArray).trimone way to do smart number sorting of strings is left pad the string to a fixed length with a known character sequence that precedes 0 in the ascii table (like *) sort the array, then go back through the array removing the pad characters. Edited July 4, 2005 by dman Link to comment Share on other sites More sharing options...
Cyber Axe Posted July 4, 2005 Author Share Posted July 4, 2005 thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now