![]() |
|
|
|
#1 |
|
Background
String functions are widely used in all applications and web reporting tool is no exception. However, common web 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. Solution As a pure Java web 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. Example Take the string splitting function Split ( ) of RAQ Report for an example as shown below: Syntax: split( srcExp,sepExp{,boolExp}) Argument: 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. Examples: (1) =split(”ab;cd;ef;tg;tt”,”;”) The return value is ["ab","cd","ef","tg","tt"]. (2) =split(”ab;c’d;e’f;tg;tt”,”;”,false) The return value is ["ab","c'd;e'f","tg","tt"]. (3) =split(”ab;c[d;e]f;tg;tt”,”;”,true) The return value is ["ab","c[d","e]f”,”tg”,”tt”]. freezea |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| The basic standard of real Excel-like reporting tool | freezea | Software | 0 | 08-04-2009 03:40 PM |
| Which is better for reporting tool: open source or charge? | freezea | Software | 0 | 05-21-2009 02:10 PM |
| Java String Problems | rbnbenjamin | General Help Related Topics | 0 | 02-03-2009 11:02 PM |
| ASP.NET: Asign Users in Roles(Array.IndexOf(Of String) method) | msandlana | Software | 0 | 04-25-2008 06:37 AM |
| Hidden linebreaks in string? VB.NET | Jiggy | Software | 0 | 04-23-2008 02:18 PM |