nsString sourceString = "The quick brown fox jumps over the lazy dog."; nsString targetString = "fox"; int position = sourceString.Find(targetString); if(position != -1) { printf("The word '%s' found at position %d.", targetString.get(), position); }This code searches for the word "fox" within the source string, and if it is found, it prints out the position of the first occurrence. The CPP nsString Find is part of the Mozilla XPCOM (Cross-Platform Component Object Model) library.