Μετάβαση στο κύριο περιεχόμενο

//ERDDAP/com.cohort.util/ScriptString2/parseInt

parseInt

[JVM]
open fun parseInt(s: String, def: Int): Int

Like parseInt(s), but returns def if error).

[JVM]
open fun parseInt(s: String): Int

Convert a string to an int. Leading or trailing spaces are automatically removed. This accepts hexadecimal integers starting with "0x". Leading 0's (e.g., 0012) are ignored; number is treated as decimal (not octal as Java would). Floating point numbers are rounded. This won't throw an exception if the number isn't formatted right. To make a string from an int, use ""+i, Integer.toHexString, or Integer.toString(i,radix).

Return

the int value from the String (or Integer.MAX_VALUE if error).

Parameters

JVM

sis the String representation of a number.