src/nhl_scores.c
// Returns new allocated string that is str in lowercase
//   and without any space characters
Returns new allocated string that is str in lowercase
and without any space characters
Returns new allocated string that is str in lowercase and without any space characters
char *new_lowercase_nospace(const char *str) {
  int len = strlen(str);
  char *lowercase = malloc(sizeof(char) * (len + 1));
  int j = 0;
  for (int i = 0; i < len; i++) {
    if (str[i] == ' ') {
      j++;
    }
    lowercase[i] = to_lowercase(str[j]);
    j++;
  }
  lowercase[len] = '\0';
  return lowercase;
}
char * new_lowercase_nospace ( const char * str ) { int len = strlen ( str ) ; char * lowercase = malloc ( sizeof ( char ) * ( len + 1 ) ) ; int j = 0 ; for ( int i = 0 ; i < len ; i ++ ) { if ( str [ i ] == ' ' ) { j ++ ; } lowercase [ i ] = to_lowercase ( str [ j ] ) ; j ++ ; } lowercase [ len ] = ' \0 ' ; return lowercase ; }
Returns new allocated string that is str in lowercase
and without any space characters
Returns new allocated string that is str in lowercase and without any space characters