Home > Contents > Index >
Expanded TOC   |    Accordion TOC   |    Annotated TOC   |    Index

 

Utilities.sortWords

Sorts a list of strings by length, from longest to shortest.

Syntax

Parameters

words
Vector of strings.

Description

The sortWords method sorts a list of strings by length, from longest to shortest. 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 from the shortest to the longest:

After executing the preceding code, the items in sortedVector are in the following order:

 

  Home > Contents > Index >

FatWire JAVA Reference
Copyright 2005 by FatWire Software
All rights reserved.