ElRubioLoco / HowManyContenders

A Trackmania Next plugin, allowing to see the total number of players who played a map.So you can more precisely see where you are in terms of performance.
https://openplanet.dev/plugin/howmanycontenders
GNU General Public License v3.0
1 stars 0 forks source link

Weird error using built-in array methods #3

Closed ElRubioLoco closed 1 year ago

ElRubioLoco commented 1 year ago

In my split string method, the built-in array methods calls generate errors :

Here is my function :

array<string> splitString(const string& in str, const string& in delimiter) {
    array<string> result;

    int startPos = 0;
    int endPos = str.findFirst(delimiter);

    while (endPos != -1)
    {
        result.insertLast(str.substr(startPos, endPos - startPos));
        startPos = endPos + delimiter.Length;
        endPos = str.find(delimiter, startPos);
    }

    result.insertLast(str.substr(startPos));

    return result;
}

Here the array is correctly initialized and the used methods are referenced here in AngelScript documentation...