String.trim
JavaScript
var text = {"a":" this is a text block "};
if(text.b && text.b.trim())
console.log("|" + text.a.trim() + "|");
var text = {"a":" this is a text block "};
if(text.b && text.b.trim())
console.log("|" + text.a.trim() + "|");