I've built a search index in Cloudant. I use trim()
to remove space in string. However, it does not work.
How can I do this?
Update:
I have a JSON object
...
"attributeArray": [
{
"name": "this is a web authentication"
}
}
...
I already extracted "name" successfully. I want to remove space in "name" then make a search index for the document. Supposing "name" has already been extracted.
var index=name.trim();
Index("default", index);
When I query, the system shows:
{
"id": "06xxxx",
"fields": [
" this is a web authentication"
]
}
I conclude that the function trim()
does not work.
PS: A small question so it does not need to explain in whole thing.