diff --git a/Strings.md b/Strings.md index 107c467..37685f5 100644 --- a/Strings.md +++ b/Strings.md @@ -68,4 +68,23 @@ This method will split a single string into multiple strings with the given deli ehs::Str_8 a = "Hello! How are you?"; ehs::Vector b = a.Split(" ", 1); ``` -**Result:** b == {"Hello!", "How are you?"} \ No newline at end of file +**Result:** b == {"Hello!", "How are you?"} + +### Find +This method will find the first instance of the delimiter. The first parameter is the delimiter. The second parameter is optional but will output the index of where the delimiter was found at, can be null if you don't care for the index. The third parameter is used for optimization, it can search either from left to right, or from right to left. The fourth parameter is the index result, it can be used to output the index at the beginning of the found delimiter or the ending. It returns true if the delimiter has been found, false otherwise. +```cpp +const Str_8 a = "Hello World!"; + +UInt_64 i; + +if (a.Find("Wo", &i, SearchPattern::RIGHT_LEFT, IndexResult::BEGINNING)) +{ + Console::Write_8("\"Wo\" found at index " + Str_8::FromNum(i) + "."); + + return 0; +} + +Console::Write_8("\"Wo\" not found."); + +return 1; +``` \ No newline at end of file