#include "nsString.h" int main() { nsAString string; // Empty string string.AppendLiteral("Hello World!"); // Appending a literal string printf("%ls", string.get()); // Output: Hello World! return 0; }
#include "nsString.h" int main() { nsAString string("Hello"); // Existing string string.AppendLiteral(" World!"); // Appending a literal string printf("%ls", string.get()); // Output: Hello World! return 0; }These examples demonstrate how to use nsAString AppendLiteral to append a string literal to an nsAString object. The package library is part of the Gecko SDK.