EGL 库 StrLib

StrLib 函数如下所示。
注: 对于 EGL,字符串是类型为 CHAR、DBCHAR、HEX、MBCHAR 或 UNICODE 的项。
系统函数和调用 描述
strLib.characterAsInt (characterExpression ) 将字符串转换为与字符表达式中的第一个字符相对应的整数字符串。
strLib.clip (characterItem ) 删除返回的字符串的结束位置的结尾空格和空值
result = strLib.compareStr (target, targetSubstringIndex, targetSubstringLength, source, sourceSubstringIndex, sourceSubstringLength) 在运行时,根据两个子串的 ASCII 或 EBCDIC 顺序来对它们进行比较,并返回值(-1、0 或 1)以指出哪个值较大。
result = strLib.concatenate (target , source) targetsource 并置;将新字符串放在 target 中;并返回一个整数以指出 target 的长度是否足以包含新字符串
result = strLib.concatenateWithSeparator (target, source, separator) 通过在 targetsource 之间插入 separator 来将它们并置;将新字符串放到 target 中;并返回一个整数以指出 target 的长度是否足以包含新字符串
strLib.copyStr (target, targetSubstringIndex, targetSubstringLength, source, sourceSubstringIndex, sourceSubstringLength) 将一个子串复制至另一个子串
db2TimeStampFormat 模式“yyyy-MM-dd-HH.mm.ss.ffffff”,这是 IBM® DB2® 缺省时间戳记格式。
defaultDateFormat 在缺省情况下指定的或由程序中的赋值语句指定的日期模式。
defaultTimeFormat 在缺省情况下指定的或由程序中的赋值语句指定的时间模式。
defaultTimeStampFormat 在缺省情况下指定的或由程序中的赋值语句指定的时间戳记模式。
eurDateFormat 模式“dd.MM.yyyy”,这是 IBM 欧洲标准日期格式。
eurTimeFormat 模式“HH.mm.ss”,这是 IBM 欧洲标准时间格式。
result = strLib.findStr (source, sourceSubstringIndex, sourceSubstringLength, searchString) 搜索子串在字符串中的第一次出现
result = StrLib.formatDate (dateValue[, characterDateFormat] 定义日期值的格式并返回类型为 STRING 的值。缺省格式为当前语言环境格式。
strLib.formatNumber (numericExpression, numericFormat) 返回格式字符串形式的数字。
result = StrLib.formatTime (timeValue[, timeFormat]) 将参数的格式定义为时间值并返回类型为 STRING 的值。缺省格式为当前语言环境格式。
StrLib.formatTimeStamp (timeStampValue[, timeStampFormat]) 将参数的格式定义为时间戳记值并返回类型为 STRING 的值。DB2 格式为缺省格式。
result = strLib.getNextToken (target, source, sourceSubstringIndex, sourceStringLength, characterDelimiter) 在字符串中搜索下一个记号并将该记号复制至 target
strLib.integerAsChar (integerExpression) 将整数字符串转换为字符串。
isoDateFormat 模式“yyyy-MM-dd”,这是国际标准组织(ISO)指定的日期格式。
isoTimeFormat 模式“HH.mm.ss”,这是国际标准组织(ISO)指定的时间格式。
jisDateFormat 模式“yyyy-MM-dd”,这是日本工业标准日期格式。
jisTimeFormat 模式“HH:mm:ss”,这是日本工业标准时间格式。
strLib.lowercase (characterItem) 将字符串中的所有大写值转换为小写值。数字和现有小写值不受影响。
odbcTimeStampFormat 模式“yyyy-MM-dd HH:mm:ss.ffffff”,这是 ODBC 时间戳记格式。
strLib.setBlankTerminator (target) 将字符串中的 NULL 终止符以及任何后续字符都替换为空格,以使 C 或 C++ 程序返回的字符串值在 EGL 生成的程序中能够正确地工作
strLib.setNullTerminator (target) 将字符串中的所有结尾空格更改为 NULL
strLib.setSubStr (target, targetSubstringIndex, targetSubstringLength, source) 用指定的字符替换子串中的每个字符
strLib.spaces (characterCount) 返回指定长度的字符串。
result = strLib.strLen (source) 返回一个项中的字节数,不包括任何结尾空格或 NULL
strLib.uppercase (characterItem) 将字符串中的所有小写值转换为大写值。数字和现有大写值不受影响。
usaDateFormat 模式“MM/dd/yyyy”,这是 IBM 美国标准日期格式。
usaTimeFormat 模式“HH:mm AM”,这是 IBM 美国标准时间格式。
使用条款 | 反馈
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.