XPCOM provides these low-level string functions to let you work with strings; however, it's often better to use one of the string classes rather than directly using these functions.
NS_CStringAppendData
function appends data to the existing value of a nsACString
instance. This is a low-level API.NS_CStringCloneData
function returns a null-terminated, heap allocated copy of the string's internal buffer.NS_CStringContainerFinish
function releases any memory allocated by a nsCStringContainer
instance.NS_CStringContainerInit
function initializes a nsCStringContainer
instance for use as a nsACString
.NS_CStringContainerInit2
function initializes a nsCStringContainer
instance for use as a nsACString
.NS_CStringCopy
function copies the value from one nsACString
instance to another. This is a low-level API.NS_CStringCutData
function removes a section of the string's internal buffer. This is a low-level API.NS_CStringGetData
function gives the caller read access to the string's internal buffer.NS_CStringGetMutableData
function gives the caller write access to the string's internal buffer.NS_CStringInsertData
function appends data to the existing value of a nsACString
instance. This is a low-level API.NS_CStringSetData
function copies data into the string's internal buffer. This is a low-level API.NS_CStringSetDataRange
function copies data into a section of the string's internal buffer. This is a low-level API.NS_CStringToUTF16
function converts the value of a nsACString
instance to UTF-16 and stores the result in a nsAString
instance.NS_StringAppendData
function appends data to the existing value of a nsAString
instance. This is a low-level API.NS_StringCloneData
function returns a null-terminated, heap allocated copy of the string's internal buffer.NS_StringContainerFinish
function releases any memory allocated by a nsStringContainer
instance. This is a low-level API.NS_StringContainerInit
function initializes a nsStringContainer
instance for use as a nsAString
. This is a low-level API.NS_StringCopy
function copies the value from one nsAString instance to another. This is a low-level API.NS_StringCutData
function removes a section of the string's internal buffer. This is a low-level API.NS_StringGetData
function gives the caller access to the string's internal buffer. This is a low-level API.NS_StringInsertData
function appends data to the existing value of a nsACString
instance. This is a low-level API.NS_StringSetData
function copies data into the string's internal buffer. This is a low-level API.NS_StringSetDataRange
function copies data into a section of the string's internal buffer. This is a low-level API.NS_UTF16ToCString
function converts the value of a nsAString
instance from UTF-16 to the specified multi-byte encoding and stores the result in a nsACString
instance.