shivam bhatele
Programmer
Hello All, I am facing some error while working on below program. Check if the string contains any of the words from the given list of string. Here's what I've done so far:
I used interviewbit java compiler to ruh this program.
This code checks if String is Word or URL. In the URL, I want to check if the URL contains list of words. I've used mydata.contains() but it only checks one single word. Can anyone suggest me?
I used interviewbit java compiler to ruh this program.
Java:
private void text_type(){
String input_data = kw_url_holder.getText().toString();
String[] words = {"google", "bing"};
if(URLUtil.isValidUrl(input_data) & input_data.contains("google")){
Toast.makeText(YTTags.this, "It's URL",Toast.LENGTH_LONG).show();
}
else{
Toast.makeText(YTTags.this, "It's Word",Toast.LENGTH_LONG).show();
}
}
This code checks if String is Word or URL. In the URL, I want to check if the URL contains list of words. I've used mydata.contains() but it only checks one single word. Can anyone suggest me?