Is there a way to delete mesh cells with particular cell index?

Actually, I want to use this mesh cell deletion to remove the mesh cells containing a specific value of the function say 1 and retain those mesh cells having another value of the function say 0. Kindly refer to my this post to get more understanding, in short I want to extract those mesh cell ids with say containing a particular value of function and deleting them.

Thanks.