length

OPL function to return the number of characters of a string

Purpose

OPL function to return the number of characters of a string.

type
int

Syntax

length(string s)

Description

Returns the number of characters in the string s. You can use this function within IBM ILOG Script statements by specifying the OPL namespace:


( Opl.xxx() )

Example

string s="Paris";

int l=length(s);

execute
{
 writeln("length(\"",s,"\") gives ",l);  
}

Result

length("Paris") gives 5