i'm making this function that replaces single slashes in a path with doubles slashes. It works for everything but slashes because I gotta use doubleslashes to specify a single slash so how do I refer to double slashes.

QString AddDoubleSlashtoPath(QString Path){
    QStringList splitup=Path.split("//") ;/*supposed to be a single slash*/
    QString newString;
    int currentStr=0;
    int stopP=splitup.size();
    while(currentStr!=stopP){
        newString.append(splitup.at(currentStr));
        if(currentStr!=stopP-1)
        newString.append("//");/*where I actually need doubleslashes */
        currentStr++;
    }
    return newString;
}

newString.append("//");/*where I actually need doubleslashes */

Do the same thing twice:

newString.append("////");/*where I actually need doubleslashes */

The double slash in string literals is an escaping measure because a single slash represents the starter for an escape character. Thus the escape character for a single slash is two: one to introduce an escape character, and the other to act as the value of the escape character. You can have as many of those escape characters as you want, but it can get confusing when there are just rows of slashes. ;)

This question has already been answered. Start a new discussion instead.