Step - cast

cast ยท category: Strings and type conversion

Converts the value to the given GType (number, string, boolean, uuid, list, map), optionally with a CastPolicy for values that do not convert.

Forms

cast(arg1: GType)
cast(arg1: GType, arg2: CastPolicy)

Example

g.inject("1", "2").cast(GType.LONG).sum().next()   // 3