String functions are widely used in all applications and reporting tool is no exception. However, common reporting tools only provide some common string functions. Such as substring acquisition, blank deleting, character conversion (character Unicode), string length, case conversion (lower upper), etc. When other string functions are needed, programmers have to realize them by programming.
Some string functions may be easy, while some may be very difficult. As the number of string functions is huge, it is impossible for programmer to realize all of them one by one.
Take string splitting for an example.
String splitting means to split a string to a string array according to separators. It seems easy, but difficult in fact. The reasons are as follows:
1. The definition of separators should be flexible according to different requirements.
2. The number of separators is variable in a string. There may be only one separator or several separators.
3. Users should be allowed to decide whether to split with the separators between two quotation marks, or brackets.
According to reason (3), it is easy to find that parameter options are important in string function.
As a pure Java reporting tool, RAQ Report provides a complete set of string functions for users' convenience. Moreover, every string function has several flexible parameter options. With these powerful string functions, users can realize their sting operations with great ease.
Take the string splitting function Split ( ) of RAQ Report for an example as shown below:
srcExp The string to be split.
sepExp The separator.
boolExp The parameter option which decides whether to split with the separator between two quotation marks, or brackets. True means to split, while false means not. The default value is false.
The return value is ["ab","cd","ef","tg","tt"].
The return value is ["ab","c'd;e'f","tg","tt"].
The return value is ["ab","c[d","e]f","tg","tt"].