how to get input in c and get rid of return character code example Example: how to remove \n from a string c str[strcspn(str, "\n")] = 0;