Adding string validation

Also fixed a syntax issue with example code.