PrivMX DOCS
API Reference/PrivMX Endpoint Swift/Core

Utils

Helper methods for removing extraneous whitespace from, and splitting std.strings.

Static Methods

trim(data:)

Removes all trailing whitespace.

Params

data

std.string

public static func trim(
data: std.string
) throws -> std.string

Returns

std.string · copy of the string with removed trailing whitespace.

ltrim(data:)

Removes all whitespace from the left of given string.

Params

data

inout std.string

inout string to trim

public static func ltrim(
data: inout std.string
) throws -> Void

Returns

`` · copy of the string with removed leading whitespace.

rtrim(data:)

Removes all whitespace from the right of given string.

Params

data

inout std.string

inout string to trim

public static func rtrim(
data: inout std.string
) throws -> Void

Returns

`` · copy of the string with removed trailing whitespace.

split(data:delimiter:)

Splits string by given delimiter (delimiter is removed).

Params

data

std.string

string to split

delimiter

std.string

string which will be split

public static func split(
data: std.string,
delimiter: std.string
) throws -> privmx.StringVector

Returns

privmx.StringVector · vector containing all split parts

We use cookies on our website. We use them to ensure the proper functioning of the site and, if you agree, for purposes we set, such as analytics or marketing.