📌  相关文章
📜  删除字符串函数 - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:38.535000             🧑  作者: Mango

代码示例1
/*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);
    }
}