Ben
public c v1 · immutable#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;}