\google\appengine\util\StringUtil

FINAL

Various PHP string related utility functions.

Methods

endsWith

STATIC   

endsWith(string $input, string $suffix) : boolean

Return true if the first paramater contains the second parameter at the end.

Parameters

Name Description

$input

string

The input string which may contain the suffix.

$suffix

string

The string to look for at the end of the input.

Returns

boolean

true iff the input contains the suffix at the end.

startsWith

STATIC   

startsWith(string $input, string $prefix) : boolean

Return true if the input string starts with the prefix string.

Parameters

Name Description

$input

string

The string which may contain the prefix at the start.

$prefix

string

The string to look for at the start of the input.

Returns

boolean

true iff the input contains the prefix at the start.

base64UrlEncode

STATIC   

base64UrlEncode(string $input) : string

Base64 encode a string, ensuring that the output is safe to use in a URL.

Parameters

Name Description

$input

string

The string which may not be url safe.

Returns

string

A Base64 encoded url safe string.

base64UrlDecode

STATIC   

base64UrlDecode(string $input) : string

Base64 decode a string that was encoded with base64UrlEncode.

Parameters

Name Description

$input

string

The url safe Base64 encoded string.

Returns

string

The original string which may not be url safe.