12.07.2015 Views

ILOG OPL Development Studio Language Reference Manual

ILOG OPL Development Studio Language Reference Manual

ILOG OPL Development Studio Language Reference Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

String operatorsString operatorsSyntaxstring1 + string2EffectReturns a string containing the concatenation of string1 and string2.Examples:"Hello," + " world" "Hello, world"When the operator + is used to add a string to a nonstring value, the nonstring valueis first converted to a string.Examples:"Your age is " + 23 -> "Your age is 23" 23 + " is your age" -> "23 is your age"string1 == string2string1 != string2The operator == returns the Boolean true if string1 and string2 are identical,and false otherwise.Two strings are identical if they have the same length and containthe same sequence of characters. The operator != is the converse of ==.Examples:"a string" == "a string" -> true "a string" == "another string" -> false "a string" == "ASTRING" -> false "a string" != "a string" -> false "a string" != "another string" -> trueWhen the operators == and != are used to compare a string with a number, the stringis first converted to a number and the two numbers are compared numerically.Examples:"12" == "+12" -> false 12 == "+12" -> truestring1 < string2string1 string2string1 >= string2The operator < returns true if string1 strictly precedes string2 lexicographically,and false otherwise. The operator true "a" < "abc" -> true "xyz" < "abc" -> false "abc" < "abc" -> false"abc" > "xyz" -> false "a" > "abc" -> false "xyz" > "abc" -> true Etc.When one of these operators is used to compare a string with a number, the stringis first converted to a number and the two numbers are compared numerically. In allother cases, the other argument is first converted to a string.Examples:"10" > "2" -> false 10 > "2" -> true 123 < "2" -> falseHint: Autocasting may cause unexpected behaviors.I L O G O P L D E V E L O P M E N T S T U D I O L A N G U A G ER E F E R E N C E M A N U A L229

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!