This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* remove Duplicate letters in a text | |
* @param textString | |
* @return | |
*/ | |
string removeDuplicates(std::string textString) { | |
if (textString.begin() == textString.end()) return textString; | |
auto no_duplicates = textString.begin(); | |
for (auto current = no_duplicates; current != textString.end();) { | |
current = std::find_if(std::next(current), textString.end(), [no_duplicates](const char c) { return c != *no_duplicates; }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* replace text in string | |
* @param str string | |
* @param from string | |
* @param to string | |
*/ | |
string replaceAll(std::string str,std::string from, std::string to) { | |
if(from.empty()) | |
return str; | |
size_t start_pos = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* a simple function that convert cursors to String Array | |
* ArioSql = https://github.com/MerajV/ArioSql | |
* @property cursor Cursor | |
* @return Array<Array<String>> | |
* @author MerajV | |
* @since 0.3.12 | |
*/ | |
fun convertCursorToArray(cursor: Cursor): Array<Array<String>> { | |
val getColumnsCount :Int = cursor.columnCount |