Skip to content
Advertisement

Tag: contains

How to get indexes of char in the string

I want to find vowels positions in the string. How can I make shorter this code? I tried contains and indexOf method but couldn’t do it. Answer I assume you want to get m2rh5b7 from your input string Merhaba based on your code, then the below works fine, Or if you want just position of the vowels position only, the

Java Contain method cannot find symbol

I am trying to only print strings containing the word “The” from a text file but the contain method does not seem to be working. Is there any other way to do this or fix the contain method? } Answer You’re calling contains on Scanner object, you should call it on the lines that you read from file, that’s the

contains() method not working as expected

I am building a voice assistant for android, here this method retrieves contact names one by one and compares it to to SpeechToText input. I am successfully getting the contact names, but when I am comparing it with my input text, nothing is happening. Here is the code Here for example I sending “call karan” as input, while debugging the

Advertisement