딸기우유중독 2018. 12. 6. 22:16

#ToIntDef


//문자열로 된 숫자를 정수형(Int)로 반환 (오류시 기본값 반환)


System.UnicodeString.ToIntDef

C++

int          ToIntDef(int defaultValue) const;

Properties

Type

Visibility

Source

Unit

Parent

function

public

ustring.h

System

UnicodeString

Description

Converts string to integer, returning a default value if the string is invalid.

ToIntDef converts the given string to an integer value and returns the integer. If the string does not contain a valid value, the value given by defaultValue is returned.


ex) {

UnicodeString TestString = "12s3";

ShowMessage(TestString.ToIntDef(2));

}


728x90