Main page Reference Manual

Extending Informix-4gl

String handling functions

Addwild

Concatenates an asterix "*" to the end of a string if not already present. The string is then ready to be used with the "matches" keyword where an asterix represents any characters.

1 parameters:
String: The source string which an asterix is to be concatenated to.

1 return value:
Result: The string with an asterix at the end.

Left

Left justifies a string, stripping leading spaces.

1 parameters:
String: The source string to be left justified.

1 return value:
Result: The left justified string.

Right

Right justifies a string, adding leading spaces.

2 parameters:
String: The source string to be right justified.
Length: The rightmost position of the resulting string.

1 return value:
Result: The right justified string.

Center

Centers a string based on a space of given length.

2 parameters:
String: The source string to be right justified.
Length: The length of the space which the string is to be centered in.

1 return value:
Result: The centered string.

Checkpath

Concatenates a slash "/" to the end of a string if not already present. The string is then ready to be used as the name of a file directory.

1 parameters:
String: The source string which a slash is to be concatenated to.

1 return value:
Result: The string with a slash at the end. If the string was null, then the result is a slash.

Firstword

Returns the first word of a string, typically a name.

1 parameters:
String: The source string.

1 return value:
Word: The first word of the string.

Lastword

Returns the last word of a string, typically a name.

1 parameter:
String: The source string.

1 return value:
Word: The last word of the string.

Strpos

Returns the position of the first occurrence substring within a string. If the substring is not contained in the string, then zero is returned.

2 parameters:
String: The full string.
Substring: The substring.

1 return value:
Position: The starting position of the substring within the string.

Strrep

Replaces all occurrences of a substring within a string with another string.

3 parameters:
String: The full string.
Substring: The substring to be replaced.
Replacement: The string which will replace the substring.

1 return value:
Result: The full string after the replacement of any occurrences of the substring.


Power-4gl manual main page