Home > Contents > Index >
Expanded TOC | Accordion TOC | Annotated TOC | Index
Utilities.sortWordsAlpha
Sorts a list of strings alphanumerically.
Syntax
public static final Vector sortWordsAlpha(Vector words)Parameters
words
- Vector of strings.
Description
The
sortWordsAlpha
method sorts a list of strings alphanumerically. A new vector is returned, leaving the original unchanged.Returns
New vector of strings (the original is untouched).
Example
The following code sorts a list of strings alphabetically:
Vector aVector = new Vector(); aVector.addElement("bear"); aVector.addElement("walrus"); aVector.addElement("cow"); aVector.addElement("llama"); Vector sortedVector = Utilities.sortWordsAlpha(aVector);After executing the preceding code, the items in
sortedVector
are in the following order:
"bear" "cow" "llama" "walrus"
Home > Contents > Index > FatWire JAVA Reference
Copyright 2005 - 2011 by FatWire Corporation
All rights reserved.