bad character

Is there a way to filter bad/invalid chracters from a string for a wave or folder name?
Im looking for something equivalent to the C isprint() function.