| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
# This library contains some useful string manipulation routines.
| Method Summary | |
int | alltrim(in str1) |
int | arr2str(inout[] arr, in sep, in count, in start)This functions concatenates all elements of the array |
int | index1(in s1, in s2) |
int | index2(in s1, in s2, in n1) |
int | join_path(in part1, in part2, in sep)Diese Funktion fügt zwei Pfadteile zusammen. |
int | ltrim(in str1) |
int | random_arr(inout[] arr1, in nnn) |
int | replace(in str, in delchr, in insstr)Replaces all delchr characters with insstr string. |
int | replace1(in s1, in s2, in s3) |
int | split_path(in path, out dir, out file, in sep)Splits a path string into a directory and file parts. |
int | split1(in s1, inout[] arr1, in s2) |
int | strip_both(in str, in zap)Removes all occuences of zap from both sides of str (trim). |
int | strip_front(in str, in zap)Removes all occuences of zap from the front of str (left trim). |
int | strip_trail(in str, in zap)Removes all occuences of zap from the end of str (right trim). |
int | substr1(in str1, in s1, in s2) |
int | trim(in str1) |
| Method Detail |
public int alltrim(in str1)
public int arr2str(inout[] arr, in sep, in count, in start)
sep.
NOTE!
Iy the arr is not sequentially inexed (starting from 0), then either the
count should NOT be defined (in operator will be used) or start must
be defined (sequential from then on).
public int index1(in s1, in s2)
public int index2(in s1, in s2, in n1)
public int join_path(in part1, in part2, in sep)
sep konvertiert
"/-->\ bzw. \-->/). Standardmeßig werden \ durch / ersetzt.
Eventuell nicht oder merfach vorhandene Separatoren in der Join-Stelle
werden auf ein EXAMPLE:
join_path( "C:\aaa", "bbb.xxx" ) ==> "C:/aaa/bbb.xxx" join_path( "C:\aaa\", "\bbb.xxx" ) ==> "C:/aaa/bbb.xxx" join_path( "", "bbb.xxx" ) ==> "/bbb.xxx" join_path( "C:/aaa" ) ==> "C:/aaa/"
public int ltrim(in str1)
public int random_arr(inout[] arr1, in nnn)
public int replace(in str, in delchr, in insstr)
delchr characters with insstr string.
NOTE1! This function internally uses split() to process the string. Unfortunatelly, split() has an undocumented "feature" that it trims blanks from the given string before splitting. This has the effect that replace() does the same. If you don't want the string to be trimmed, use replace1().
NOTE2!
The replace() replaces each occurence of individual characters within
delchr with the complete string insstr. It does NOT replace string
delchr with the string insstr.
public int replace1(in s1, in s2, in s3)
public int split_path(in path, out dir, out file, in sep)
path string into a directory and file parts. The path
separator can be defined with sep (default: backslash)
NOTE!
The function does not analyse whether the file part is indeed a file name.
Anything following the last file. Anything before is
treated as dir.
NOTE2!
dir does not end with sep.sep)sep)
public int split1(in s1, inout[] arr1, in s2)
public int strip_both(in str, in zap)
zap from both sides of str (trim).public int strip_front(in str, in zap)
zap from the front of str (left trim).public int strip_trail(in str, in zap)
zap from the end of str (right trim).public int substr1(in str1, in s1, in s2)
public int trim(in str1)
| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||