TString myString = "Hello, World!"; TString lastFour = myString.Last(4); // lastFour = "rld!"
TString myString = "abcdefg"; TString lastThree = myString.Last(3); // lastThree = "efg"In both examples, the Last function returns a TString object that contains the last n characters of the input string. This function can be useful for manipulating filenames, extracting file extensions, or selecting the last few characters of a long string.