nsACString str; str.AssignLiteral("hello world!");
const char* first_name = "John"; const char* last_name = "Doe"; nsACString full_name; full_name.AssignLiteral(first_name); full_name.AppendLiteral(" "); full_name.AppendLiteral(last_name);In this example, two C string literals `first_name` and `last_name` are combined to create a new string `full_name` using `AssignLiteral()` method to assign the first name and `AppendLiteral()` method to append the last name. Package Library: Gecko SDK's C++ library `nsStringAPI.h`