Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

delete string function in c

/*The logic behind the function is to copy and place the ending part of string
along with the deliminator '' 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);
    }
}
Source by www.programming9.com #
 
PREVIOUS NEXT
Tagged: #delete #string #function
ADD COMMENT
Topic
Name
8+2 =