sample code for removing duplicate chars from a cstring