toJSONPattern method
Implementation
String toJSONPattern({SearchPatterns pattern = SearchPatterns.q}) {
if (isNotEmpty) {
String tmp = trim();
while (tmp.contains(" ")) {
tmp = tmp.replaceAll(" ", " ");
}
tmp = tmp.replaceAll(" ", "%20");
tmp = "${pattern.name}=$tmp";
return tmp;
} else {
return "";
}
}