Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Functions String.slice

1
2
3
4
5
module juptune.core.ds.string;

const char[] slice(
    
);

Documentation

Provides access to the raw slice of the string, which will always be on the heap.

Notes

This function may return a nullslice if the string is empty.

This function will promote the string to become a "Big" string if it wasn't already. This means that it may allocate memory on the heap.

This function is best used when you're certain that the returned slice will not escape and is short lived, as the underlying payload may be released once the parent Stringgoes out of scope.

This function is safer than sliceMaybeFromStackas it will always return a slice to the heap.

Returns

A slice to the string's memory.

See_Also

String.sliceMaybeFromStack, String.access.