at first apologize for poor English.
i have a EditText and i wanna implement advance search scenario where have a String that has 3 or more words in EditText and when i know two words of string show me the row.
for example i have a String like "Touch Screen Assembly".i know "Touch" and "Assembly" and i write Touch Assembly in EditText.but Room can't show me any row.
when i write touch word show me row
but when i write first word and third any row show
and my Room Query is #Query("SELECT * FROM tbl_dataItem WHERE productName LIKE '%'||:keyword||'%' ")
Single<List<DataItem>> search(String keyword);
this is EditText code
Related
I would like to define a new style of ordered lists in asciidoctor that is composed of a fixed uppercase letter and a counter that increments. It has to be document wide. For example
A1. first item
A2. second item
some text
A3. third item
the flow of the text continues
The solution I came up with is as follows, which is heavy and not 100% satisfactory.
[horizontal]
A{counter:ol1}.:: first item
A{counter:ol1}.:: second item
some text
[horizontal]
A{counter:ol1}.:: third item
the flow of the text continues
Is there a simpler solution ? Is there a possibility at least to define a macro that would expand to A{counter:ol1}.::?
You have a couple of choices:
Create a macro in your editor that inserts the required markup (assuming that your goal is to reduce the amount of typing to achieve this effect).
Adjust the markup to specify a custom role and drop the counter:
= My document
:docinfo: shared
[horizontal, role=numbered]
A:: first item
A:: second item
some text
[horizontal, role=numbered]
A:: third item
the flow of the text continues
Then add some custom CSS, via a docinfo file (see: https://asciidoctor.org/docs/user-manual/#docinfo-file), that does the counting for you. This won't work in PDF output.
body {
counter-reset: myli;
}
.hdlist.numbered .hdlist1::after {
content: counter(myli) ". ";
counter-increment: myli;
}
I have a file that contain information :
Cant Stop The Feeling! Justin Timberlake
One Dance Drake Featuring
like that separated by "\t"
my question is how I can take the first String which is here "One Dance " and put it in a String and take the Artist name "Drake Featuring "and put it in another using methods from String class .
The problem is this:
In my programme at first the user gets options for a first name - so hopefully he likes something from the options and he chooses it -so far everything is OK!
But then when he types space he starts receiving options for second name and a if he likes something and chooses it - then the Autocomplete just erases the first name. Is there any way I can change that?
hello Rich thank you very much or your response - now i've decided to change my task and here is what I made when a user types for example I character i get all the first names that start with I- so far no problem! ANd when he types the white space and K for example I make request to my web service that gets the middle names that starts with K or the last names that start with K (one of them should start with K for Iwelina), so in this case for Iwelina Ive got RADULSKA KOSEWA and KOSEWA NEDEWA! For the source of autocomplete I concatenate iwelina with (radulska kosewa)and iwelina with (KOSEWA NEDEWA) so at the end I've got IWELINA IELINA RADULSKA KOSEWA and IWELINA KOSEWA NEDEWA!!! the only problem is that when i type Iwelina K i get only IWELINA KOSEWA NEDEWA!!!here is the code for autocomlete
$('#input').autocomplete({
source: function(request, response) {
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term, " "));
var data = $.grep( srcAutoComp, function(value) {
return matcher.test( value.label || value.value || value );
});
response(data);
}
});
if you know how i can change it I will be glad for the help
I don't understand how, when the user begines to type the second name, he's getting results that are only the last name. For example, if he types "Joh" and selects "John" from the options, and then continues to type "John Do", then how is it possible that your drop down gives him results for only the last name, like "Doe"?
At any rate, assuming this is truly happening, you could just combine all combinations of first and last names in your source data and that will show "John Doe" in the drop down when the user types "Joh" selects "John" and then continues to type "John Do".
Another way to do this is with a complicated change to the search and response events to search after a space if it is there, and recombine it with the first string after the search for the last name is complete. If you give me your source data, I could put something together for this.
I searched but nothing explains how to do this,
for example
Dim sentence as String = "cat is an animal"
if i make a msgbox :
MsgBox(sentence)
it shows
cat is an animal
how to make a msgbox that says
cat
is
an
animal.
Easy way Replace space with new line
as in string words = MyString.Replace(" ","\r\n")
Split would be split on space in to an array , and then join that back up with new lines which is pointless unless you need the array for something else.
I am trying to create a string mutation that, after a prompt for a city and state, would output the state in uppercase, followed directly by the city in lowercase, followed directly by the state again in uppercase.
I have tried many types of mutations but nothing is working.
Can anyone help me?
use String#toUpperCase() and String#toLowerCase() methods.
eg. System.out.println(state.toUpperCase());
Here is one in java
Scanner sc =new Scanner(System.in);
String city,state;
System.out.println("Enter City =");
city=sc.nextLine();
System.out.println("Enter State =");
state=sc.nextLine();
System.out.println( state.toUpperCase() + " "+city.toLowerCase() + " "+ state.toUpperCase());
Independent of any programming language(But dependent on character Representation) you could retrieve every character of string and add 22 which would convert UPPERCASE into LOWERCASE.As you must be knowing ASCII values of a-z is 97-122 and that of A-Z is 65-90.so you can lookout how much to add/ subtract to convert between cases.