nsACString str = NS_LITERAL_ACSTRING("Hello, world!");
nsACString str1 = NS_LITERAL_ACSTRING("Hello, "); nsACString str2 = NS_LITERAL_ACSTRING("world!"); str1.Append(str2);
nsACString str = NS_LITERAL_ACSTRING("Hello, world!"); const char *cstr = str.get();This example shows how to convert an nsACString object to a C-style string. The nsACString data type is included in the Mozilla codebase, specifically in the XPCOM library.