function finalString = erase (parentstring, childstring)
  if (isnull (parentstring) )                         # Return NULL if the parent string is NULL
    finalString = parentstring;
  elseif (isnull (childstring))                       # Return parent string as it is if child string is NULL
    finalString = parentstring;
  else
    parentstring = cellstr (parentstring);            # Change the input array of characters to cell arrays
    childstring = cellstr (childstring);              
    if (! iscellstr (parentstring) )                  # Edge case error if any of the literal in the array in non string
      error ("erase : argument 1 must contain all the members as strings");
    endif
    for i = 1:rows(parentstring)
      for j = 1:rows(childstring)
        while (1)
          if( isempty(parentstring{i}) || length (strfind (parentstring{i},childstring{j})) == 0)
            break;
          elseif(strcmp (parentstring{i},childstring{j}) == 1)
            parentstring{i} = [];
            continue;
          elseif(length(parentstring{i}) < length(childstring{j}))
            continue;
          endif
          index = strfind (parentstring{i},childstring{j})(1);
          if(index == 1)
            parentstring{i} = substr(parentstring{i},index + length(childstring{j}));
            parentstring{i} = strtrim(parentstring{i}); 
          elseif(index == length(parentstring{i})-length(childstring{j}) +1)
            parentstring{i} = substr(parentstring{i},1,index-1);
          else 
            parentstring{i} = cstrcat (substr (parentstring{i},1,index-1),substr (parentstring{i},index+length(childstring{j})+1));
          endif
        endwhile
      endfor   
      
    endfor
    parentstring = deblank (parentstring);
    parentstring = char (parentstring);
    finalString = parentstring;
  endif