I have purchased 2 courses to understand Selenium and Java and i spent almost 13k rupees, they didn't tell me so elaborately even after charging so much. your tutorials are really helpful, one can easily understand and learn, moreover they can get enough confidence in few days to crack any MNC interview. Great job Naveen. Keep it up. please keep these tutorials free in future as well.
@FitHighFive3 жыл бұрын
Thank you so much Naveen for this video, really got clear picture on String methods.
@subhashpatil42865 жыл бұрын
Sir, no words for your explanation. You are simply born to teach!!!!
@yolwasmirzat6 жыл бұрын
This helps me a lot , thank you so much , this makes my java basic is so clear , and recently have interview , your interview section also helps me a lot .
@aparnabhosale748310 ай бұрын
so beautifuuly explained..thnku sir
@harishpandey90036 жыл бұрын
very helpful, I used to watch your video, The way you explaining the things is very easy to understand.
@lisazhou77765 жыл бұрын
very good and very helpful. Thanks a lot Naveen!
@shilpathada58323 жыл бұрын
String str = "The rains have started here selenium"; System.out.println(str.indexOf(('s'), str.indexOf('s') + str.indexOf('s')+1));//3rd occurrence of 's'
@MarkGavrilov2 жыл бұрын
This one works as well: System.out.println(str.indexOf('s',str.indexOf('s')+str.indexOf('s',+1)));
@softwaretestingatoz3160 Жыл бұрын
System.out.println(str.indexOf('s',str.indexOf('s' +1)+1)); its this correct way to find 3rd veriable?
@shubhtiwari46825 жыл бұрын
occurrence of third 's' System.out.println(str.indexOf('s', str.indexOf('s', str.indexOf('s')+1)+1));
@bharatvarshney26666 жыл бұрын
Thanks for your efforts Naveen Sir, it is really worthful for me to clear concept in java
@tikarobinson93355 жыл бұрын
Thank you so much, this helps alot.
@navathutejomai10382 жыл бұрын
Sir I got a doubt as string is immutable how can we concatenate and assign to same string, just read on net that a new string is created and it reference is set to the object reference.
@ParthKandpal5 жыл бұрын
Hi Naveen, Please find below the code for 3rd occurence of s String str="The Rains have started here selenium"; System.out.println(str.indexOf("s", str.indexOf("s")+str.indexOf("s")+1)); output will be -->28 Thanks :)
@softwaretestingatoz3160 Жыл бұрын
System.out.println(str.indexOf('s',str.indexOf('s' +1)+1)); its this correct way to find 3rd veriable?
@saig36602 жыл бұрын
Awesome lecture...
@deepikavijay38465 жыл бұрын
Hi Naveen. Nice video. Could you please prepare a video for Regex ?
@venkateshandea17676 жыл бұрын
Hey Naveen anna you are doing great job I'm finding these days that everyone suggesting ur videos to others in selenium groups and everywhere though ur channel is quite is new u r reaching aspirants very quickly ....and help me with this I'm not able to print 3rd occurance of 's'...I did this System.out.println(s.indexOf('s', s.indexOf('s', s.indexOf('s')+1))); ...
@lekhraj43956 жыл бұрын
starting index should be 15; String str = "The rains have started here in selenium"; System.out.println(str.length()); System.out.println(str.charAt(5)); System.out.println(str.indexOf("s")); System.out.println(str.indexOf("s", str.indexOf("s")+1)); System.out.println(str.indexOf("s", str.indexOf("s")+15));
@saranyasanapala10496 жыл бұрын
If any one done this plz post here
@borgjoseph6 жыл бұрын
public static void main(String[] args) { FindNthIndexOfACharacter('s', "The rains have started here in selenium", 3); } private static void FindNthIndexOfACharacter(char c, String str, int position) { int count = 0; //str = str.replaceAll("\\s", ""); -- uncomment this line if you want to remove spaces for (int i = 0; i < str.length(); i++) { if (str.toUpperCase().charAt(i) == Character.toUpperCase(c)) { count += 1; if (count == position) { System.out.println(i); break; } } }
@sumirozario9045 жыл бұрын
@@saranyasanapala1049 String str ="The rain has started here for some reason"; System.out.println("The location of second occurence of 's' is :" +str.indexOf('s',str.indexOf('s')+1)); System.out.println("The location of third occurence of 's' is :" +str.lastIndexOf('s', str.lastIndexOf('s')-1)); System.out.println("The location of last occurence of 's' is :" +str.lastIndexOf('s'));
Hi Naveen, i am unable to print the 3rd occurance in the sentence, tried it in many ways. Google is having some complex code. Could you please provide your inputs.
The letters are not clearly visible. Explanation is good.
@Ruchi5695 жыл бұрын
Thanks a lot ! Please do a few programs on Collections...
@DaddyPrincess5 жыл бұрын
Really awesome tutorial!
@manju1ification5 жыл бұрын
Hi Naveen can you add program to find (first and last)non repeated character in a string
@shankarpk895 жыл бұрын
package javaPrograms; public class NonRepeatingChar { public static void main(String[] args) { String str = "INDIAFORINDIANSFIRST"; System.out.println("FIRST NON REPEATING CHARACTER IS : " + findFirstNonRepeatingCharacter(str)); System.out.println("LAST NON REPEATING CHARACTER IS : " + findLastNonRepeatingCharacter (str)); } public static char findFirstNonRepeatingCharacter(String str) { str = str.toUpperCase(); char chr = 0; for (int i = 0; i < str.length(); i++) { if (!str.substring(i + 1).contains(Character.toString((str.charAt(i))))) { chr = str.charAt(i); break; } } return chr; } public static char findLastNonRepeatingCharacter(String str) { str = str.toUpperCase(); char chr = 0; for (int i = 0; i < str.length(); i++) { if (!str.substring(0, str.length() - i - 1) .contains(Character.toString((str.charAt(str.length() - i - 1))))) { chr = str.charAt(str.length() - i - 1); break; } } return chr; } }
@khushbooshah74412 жыл бұрын
one doubt Output2.IndexOf("W",Output2.IndexOf("W")+1) how will i get the index of 3rd occruence of W in string
@surekapandian10753 жыл бұрын
Telegram link is expired... Is there new link?
@arabindamohanty21905 жыл бұрын
Thanks a lot
@buvanapandu6 жыл бұрын
System.out.println(str.indexOf('s',str.indexOf('s' +1)+1)); //3rd occurrence of s or any occurrence
@buvanapandu6 жыл бұрын
is it correct? im getting the correct answer but im not sure whether we can do this way
@samhitasegar28644 жыл бұрын
@buvanan Rajendiran - Is this correct way to get third occurence of s?
@ujjwalverma77876 жыл бұрын
sir, please help me i really confuse between them what is the difference between the "array.length and array.length()" some time array.length will work and some time array.length() will work. is there is any rules for is for using it? with String arr.length() will work but when we use an integer type, its work with array.length.
@kapilrana23616 жыл бұрын
As far as I know you can not use .length( )with array. For find the length of an array you should write array.length. Like if String s = "test", the you can write s.length(). and if you have int numbers[] = {-10,-10,24,50,-88,276435}; the you can write int len = numbers.length;
@tejastoley67145 жыл бұрын
length is use to find the size of the array and length() is use to find the size of the string.
@kuldeepsikka27225 жыл бұрын
@@kapilrana2361 you are right array.length is a variable and array.length() is a method.
@Testprofile-u8b5 күн бұрын
Using new keyword creates memory in heap and SCP . Why is that soo?
@nazimkhan90803 жыл бұрын
Lets take this example String s="_Hello_world_"; String test[]=s.split("_"); System.out.println(test.leangth);// Return 3: Why?
@aakashkhandekar Жыл бұрын
PLEASE MAKE VIDEOS ON ZOOM MODE. I AM NOT ABLE TO SEE YOUR CODES PROPERLY...
@manishgupta53446 жыл бұрын
Hi Naveen! How to find the numbers of ‘L’ in a string “GOOGLLLLLEE”?
@_abhimanyu.6 жыл бұрын
we can do this using HashMap
@romalisasamal71095 жыл бұрын
public int lengthOf() { String s="GOOGLLLLLEE"; int first=s.indexOf('L'); int last=s.lastIndexOf('L'); int counter=0; for(int i=first;i
@shankarpk895 жыл бұрын
String s = "GOOGLLLLLEE"; int counter =0; for(int i=0; i
@shankarpk895 жыл бұрын
package javaPrograms; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; public class CountChar { public static void main(String[] args) { String inputStr = "GOOGLLLLLEE"; Map myMap = countCharacters(inputStr); for (Entry entry : myMap.entrySet()) { System.out.println(entry.getKey() + " : " + entry.getValue()); } } public static Map countCharacters(String str) { Map map = new HashMap(); int counter = 1; for (int i = 0; i < str.length(); i++) { if (!map.containsKey(str.charAt(i))) { map.put(str.charAt(i), counter); } else { map.put(str.charAt(i), map.get(str.charAt(i)) + 1); } } return map; } }
@GreatStoriesTakeTime3 жыл бұрын
String a="GOOGLLLLLEE"; int b=(int)a.chars().filter(e->e=='L').count(); System.out.print(b);
@gautamgkp655 жыл бұрын
Awesome
@marine0075 жыл бұрын
String str="ae@io#b$u123"; Separate characters,special characters and numbers......this was a interview question. sir,plz answer this
@nandhanamtalkies23325 жыл бұрын
public class StringManipulation { public static void main(String[] args) { String str2 = "ae@io#b$u123"; System.out.println("Characters are : "+ str2.replaceAll("[^a-zA-Z]", "")); System.out.println("Numbers are : "+ str2.replaceAll("[^0-9]", "")); System.out.println("Special characters are : "+ str2.replaceAll("[a-zA-Z0-9]", "")); } } O/P Characters are : aeiobu Numbers are : 123 Characters are : @#$