how to remove \n from a string c
str[strcspn(str, "\n")] = 0;
how to remove \n from a string c
str[strcspn(str, "\n")] = 0;
delete string function in c
/*The logic behind the function is to copy and place the ending part of string
along with the deliminator '\0' to the position from where you want the
"no_of_char" number of characters removed*/
void delchar(char *string,int starting_pos, int no_of_char)
{
if (( starting_pos + no_of_char - 1 ) <= strlen(x) )
{
strcpy(&x[starting_pos-1],&x[starting_pos + no_of_char-1]);
puts(x);
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us