문제

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