make string check very generic

Change-Id: I9a3bf6a57e1b8920be2f02d0425f043cfdb8166f