To check check a string if there is no comma i use this right?

if (, !isin $1) { }

but how the i make it check if "before and after the comma" there is no space? like "testing,testing" and not
"testing, testing" or "testing ,testing" or any other similar combination???