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 functionsString functionsSyntaxString.fromCharCode(code)EffectReturns a single-character string containing the character with the givenASCII code.Examples:String.fromCharCode(65) -> "A" writeln(String.fromCharCode(0x30)); ->"0"parseInt(string [ , base ] )Parses string as an integer written in the given base, and returns its value.If the string does not represent a valid integer, NaN is returned.Leading white space characters are ignored. If parseInt encounters acharacter that is not a digit in the specified base, it ignores it and allsucceeding characters and returns the integer value parsed up to thatpoint.If base is omitted, it is taken to be 10, unless string starts with 0x or 0X,in which case it is parsed in base 16, or with 0, in which case it is parsedin base 8.Examples:parseInt("123") -123 parseInt("-123") -123 parseInt("123.45") 123parseInt("1001010010110", 2) 4758 parseInt("a9", 16) 169 parseInt("0xa9")169 parseInt("010") 8 parseInt("123 poodles") 123 parseInt("a lot ofpoodles") NaNparseFloat(string)Parses string as a floating-point number and return its value. If the stringdoes not represent a valid number, NaN is returned.Leading white space characters are ignored.The string is parsed up to thefirst unrecognized character. If no number is recognized, the function returnsNaN.Examples:parseFloat("-3.14e-15") -3.14e-15 parseFloat("-3.14e-15 poodles")-3.14e-15 parseFloat("a fraction of a poodle") NaN228I 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 L

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

Saved successfully!

Ooh no, something went wrong!