Вопрос

I've added search to my code and now am I wondering about one thing.

I'm using Parse.com's method:

query.whereContains("my_strings_from_Parse", text_from_EditText.toLowerCase())

I've made the text from EditText to lower-case bur right now do i need to make the strings from Parse.com lower-case.

Do you have any idea how to do it?

Intent intent = getIntent();
        String query = intent.getStringExtra("query");
ParseQuery<Animal> squery = ParseQuery.getQuery(Animal.class);
squery.whereContains("animal", query.toLowerCase()); //I need to make content of                                                                                                                                                                                                           //"animal"

Это было полезно?

Решение

You can use a regex with the case insensitive modifier, like stated here:

public ParseQuery<T> whereMatches(String key, String regex, String modifiers)

Add a regular expression constraint for finding string values that match the provided regular expression. This may be slow for large datasets.

Parameters:

key - The key that the string to match is stored in.
regex - The regular expression pattern to match.
modifiers - Any of the following supported PCRE modifiers:
    i - Case insensitive search
    m - Search across multiple lines of input

Returns: Returns the query, so you can chain this call.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top