const char* charStr = "hello"; nsString nsStr = NS_ConvertUTF8toUTF16(charStr);
nsString nsStr1 = "hello"; nsString nsStr2 = "world"; nsStr1.Append(nsStr2);In this code, the Append method appends nsStr2 to the end of nsStr1. The package library for nsString is part of the Mozilla Gecko SDK.