In this example, we create a TString object called 'str' that contains the string "Hello, world!". We then use the 'Index' function to search for the substring "world" within the string. The function returns the index of the first occurrence of the substring, which is 7 in this case. Example 2: Replace a substring within a stringc++ #include