String
struct String
-
Creates a string from
PerlScalar
. Throws ifsv
does not contain a string or a number.let s = try String(PerlScalar()) // throws let s = try String(PerlScalar(200)) // s == "200" let s = try String(PerlScalar("OK")) // s == "OK" let s = try String(PerlScalar(referenceTo: PerlScalar(10))) // throws
Declaration
Swift
public init(_ scalar: PerlScalar) throws
-
Creates a string from
PerlScalar
using Perl macrosSvPV
. Performs no additional checks.let s = String(PerlScalar()) // s == "" let s = String(PerlScalar(200)) // s == "200" let s = String(PerlScalar("OK")) // s == "OK" let s = String(PerlScalar(referenceTo: PerlScalar(10))) // s == "SCALAR(0x12345678)"
Declaration
Swift
public init(unchecked scalar: PerlScalar)