qsu library

Functions

arrMove(List array, int from, int to) List
Moves the position of a specific element in an array to the specified position. (Position starts from 0.)
arrRepeat(dynamic array, int count) List
Repeats the data of an Array or Map a specific number of times and returns it as a 1d array.
arrShuffle<T>(List<T> array) List<T>
Shuffle the order of the given array and return.
arrTo1dArray(List array) List
Merges all elements of a multidimensional array into a one-dimensional array.
arrUnique(List array) List
Remove duplicate values from array and two-dimensional array data. In the case of 2d arrays, json type data duplication is not removed.
arrWithDefault(dynamic defaultValue, int length) List
Initialize an array with a default value of a specific length.
arrWithNumber(int start, int end) List<int>
Creates and returns an Array in the order of start...end values.
average(List<double> array) double
Returns the average of all numeric values in an array.
capitalizeEachWords(String str, {bool natural = false}) String
Converts every word with spaces to uppercase. If the naturally argument is true, only some special cases (such as prepositions) are kept lowercase.
capitalizeEverySentence(String str, {String? splitChar}) String
Capitalize the first letter of every sentence. Typically, the . characters to separate sentences, but this can be customized via the value of the splitChar argument.
capitalizeFirst(String str) String
Converts the first letter of the entire string to uppercase and returns.
contains(dynamic str, dynamic search, {bool exact = false}) bool
Returns true if the first string argument contains the second argument "string" or "one or more of the strings listed in the array". If the exact value is true, it returns true only for an exact match.
funcTimes(int times, dynamic iteratee) List
Repeat iteratee n (times argument value) times. After the return result of each function is stored in the array in order, the final array is returned.
is2dArray(List array) bool
Returns true if the given array is a two-dimensional array.
numberFormat(dynamic number) String
Return number format including comma symbol.
removeNewLine(String str, {String replaceTo = ''}) String
Removes \n, \r characters or replaces them with specified characters.
removeSpecialChar(String str, {String? exceptionCharacters}) String
Returns after removing all special characters, including spaces. If you want to allow any special characters as exceptions, list them in the second argument value without delimiters. For example, if you want to allow spaces and the symbols & and *, the second argument value would be ' &*'.
replaceBetween(String str, String startChar, String endChar, String replaceWith) String
Replaces text within a range starting and ending with a specific character in a given string with another string. For example, given the string abc<DEF>ghi, to change <DEF> to def, use replaceBetween('abc<DEF>ghi', '<', '>', 'def'). The result would be abcdefghi. Deletes strings in the range if replaceWith is not specified.
sleep(int delay) Future<void>
Sleep function using Promise.
strCount(String str, String search) int
Returns the number of times the second String argument is contained in the first String argument.
strRandom(int length, {String? additionalCharacters}) String
Returns a random String containing numbers or uppercase and lowercase letters of the given length. The default return length is 12.
strShuffle(String str) String
Randomly shuffles the received string and returns it.
strToAscii(String str) List<int>
Converts the given string to ascii code and returns it as an array.
strUnique(String? str) String
Remove duplicate characters from a given string and output only one.
trim(String str) String
Removes all whitespace before and after a string. Unlike JavaScript's trim function, it converts two or more spaces between sentences into a single space.
truncate(String str, int length, {String? ellipsis}) String
Truncates a long string to a specified length, optionally appending an ellipsis after the string.
truncateExpect(String str, int expectLength, {String? endStringChar}) String
The string ignores truncation until the ending character (endStringChar). If the expected length is reached, return the truncated string until after the ending character.
urlJoin(List<String?> args) String
Merges the given list argument (the beginning of the URL), joining it so that the slash (/) symbol is correctly included.