nsAString str = NS_LITERAL_STRING("Hello, world!"); int index = str.FindChar(','); // index will be 5
nsAString str = NS_LITERAL_STRING("Lorem ipsum"); int index = str.FindChar('x'); // index will be -1In this example, we create a `nsAString` object `str` initialized with the string "Lorem ipsum". We then call `FindChar()` on `str` passing the character `x` as the argument. The function returns -1 because `x` does not occur in the string. The `nsAString` class is part of the Gecko SDK library provided by Mozilla for developing applications using the Gecko engine.