All pastes #36499 Raw Edit

Ben

public c v1 · immutable
#36499 ·published 2006-01-11 18:04 UTC
rendered paste body
#include <stdio.h>#include <string.h>int oneSpace(char s[]) {    int i;    printf("original: %s\n", s);    /* convert the \t and \n to newlines first */    for(i = 0; i < strlen(s); i++) {        if(s[i] == '\n' ||           s[i] == '\t'          ) {        s[i] = ' ';        }    }    printf("new: %s\n", s);}int main(int argc, char **argv) {    oneSpace("   this    is\ta   \n  \ttest\n\n\n\n");    return 0;}