int32 FindLast(const char *string, int32 length) const; int32 FindLast(const char *string, int32 fromOffset, int32 length) const; int32 FindLast(const BString &string) const; int32 FindLast(const BString &string, int32 fromOffset) const;
BString str("Hello, World!"); int32 index = str.FindLast("o"); // returns 8 BString fileName("example.txt"); int32 dotIndex = fileName.FindLast("."); // returns 7 BString path("/usr/local/bin/"); int32 binIndex = path.FindLast("bin/"); // returns 10 BString paragraph("This is a long paragraph."); int32 lastWordIndex = paragraph.FindLast(" "); // returns 19In the above examples, we create BString objects and use the FindLast function to find the index of the last occurrence of a character or sub-string. The package library for this function is the BeOS API.