IText versus IString
Earlier releases of IBM Open Class relied more on IString than
on IText, which is designed to replace it. Nevertheless, IString
remains useful for certain functions, such as numeric formatting
and parsing, case conversion, language-sensitive or
case-insensitive searching, iterative find and replace, and space
padding. While IText is usually a better choice, the differences
are summarized here:
Use IText:
- if you need to store styled text
- if you want to store international (non-ASCII) text
- if you want powerful language-sensitive comparison
- if you want to store really long runs of text
Note that IText has:
- no numeric support
- ties to the IOC Localization and 2DGraphics Frameworks
Use IString:
- if you need numeric formatting and parsing
- if the object is going to be used with a lot of
char*-based system calls, which would force IText to
create unnecessary overhead by transcoding repeatedly
Note that IString:
- uses styles via changing fonts
- is used by User Interface Classes