Answers for "remove characters from string in c"

C
1

remove first character from string c

if (contents[0] == '\n') 
    memmove(contents, contents+1, strlen(contents));
Posted by: Guest on November-18-2020
2

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);
    }
}
Posted by: Guest on June-21-2020

Code answers related to "remove characters from string in c"

Code answers related to "C"

Browse Popular Code Answers by Language