Skip to main content
Commonmark migration
Source Link

#C, 52 bytes

C, 52 bytes

j;f(char*s){for(j=0;*s=s[j];s[j]==94?s--,j+=3:s++);}

We define a function f that takes a pointer to the string as input. After the function call, that pointer will contain a modified string.

A simple test:

int main(int argc, char** argv) {
    char buf[300] = "Digital Trauma^H^H^H^H^H^H^H^H^H^H^H^H^H^HMaria Tidal Tug^H^H^H^H^H^H^H^H^H^H^H^H^H^H^HDigital Trauma";
    f(buf);
    printf(buf);
    return 0;
}

The above prints:

Digital Trauma

#C, 52 bytes

j;f(char*s){for(j=0;*s=s[j];s[j]==94?s--,j+=3:s++);}

We define a function f that takes a pointer to the string as input. After the function call, that pointer will contain a modified string.

A simple test:

int main(int argc, char** argv) {
    char buf[300] = "Digital Trauma^H^H^H^H^H^H^H^H^H^H^H^H^H^HMaria Tidal Tug^H^H^H^H^H^H^H^H^H^H^H^H^H^H^HDigital Trauma";
    f(buf);
    printf(buf);
    return 0;
}

The above prints:

Digital Trauma

C, 52 bytes

j;f(char*s){for(j=0;*s=s[j];s[j]==94?s--,j+=3:s++);}

We define a function f that takes a pointer to the string as input. After the function call, that pointer will contain a modified string.

A simple test:

int main(int argc, char** argv) {
    char buf[300] = "Digital Trauma^H^H^H^H^H^H^H^H^H^H^H^H^H^HMaria Tidal Tug^H^H^H^H^H^H^H^H^H^H^H^H^H^H^HDigital Trauma";
    f(buf);
    printf(buf);
    return 0;
}

The above prints:

Digital Trauma
Source Link
BrainSteel
  • 5.5k
  • 3
  • 19
  • 39

#C, 52 bytes

j;f(char*s){for(j=0;*s=s[j];s[j]==94?s--,j+=3:s++);}

We define a function f that takes a pointer to the string as input. After the function call, that pointer will contain a modified string.

A simple test:

int main(int argc, char** argv) {
    char buf[300] = "Digital Trauma^H^H^H^H^H^H^H^H^H^H^H^H^H^HMaria Tidal Tug^H^H^H^H^H^H^H^H^H^H^H^H^H^H^HDigital Trauma";
    f(buf);
    printf(buf);
    return 0;
}

The above prints:

Digital Trauma