Convert String to Capitalize String in java

  Рет қаралды 11,807

Naveen AutomationLabs

Naveen AutomationLabs

Күн бұрын

Convert String to Capitalize String in java
Schedule a meeting in case of any queries/guidance/counselling:
calendly.com/n...
~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
www.youtube.co...
Follow me on my Facebook Page:
/ naveenqtpexpert
Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:
t.me/joinchat/...
Naveen AutomationLabs Paid Courses:
GIT Hub Course:
naveenautomati...
Java & Selenium:
naveenautomati...
Java & API +POSTMAN + RestAssured + HttpClient:
naveenautomati...

Пікірлер: 25
@tapaskhandai
@tapaskhandai 2 жыл бұрын
Hi Naveen Thanks for great work you are doing that helps Automation tester like me a lot. I tried this in another way like below: static void capitalizeString(String str) { String result = ""; String[] ar = str.split("\\s"); for (String s : ar) { char c = Character.toUpperCase(s.charAt(0)); result = result + s.replace(s.charAt(0), c)+" "; } System.out.println(result); }
@rgawali9
@rgawali9 Жыл бұрын
In this if I want to uppercase only 3character of 2nd word how can we do it?
@deepa8177
@deepa8177 2 жыл бұрын
Thanks for covering test cases also, it actually helps to think in those directions also as a beginner in coding.
@testinginsights-muktasharma
@testinginsights-muktasharma 2 жыл бұрын
Great demonstration to make us understand the concept. Thank you!
@kapilsachan
@kapilsachan 2 жыл бұрын
This is: *The* Naveen Automation Lab guys....
@reks5936
@reks5936 2 жыл бұрын
Hi Naveen, Thanks for your continuous videos which is very much helpful to clear the interviews.. kindly explain in a video about when to use static and non static variables in real-time testing
@sureshgarine
@sureshgarine 2 жыл бұрын
Hi Naveen, thank you for starting on coding questions, Please continue the good work. I solved it without Split and upper case function, making it very performant with String builder and ASCII conversion. Added comments for better reach My solution private static String camelCaseSentence(String str) { if(str.length()== 0 || str == null) return str; StringBuilder sb = new StringBuilder(); sb.append((char)(str.charAt(0) -'a'+'A'));//converting the character with ascii value, first trying to find difference and add it to ascii value of 'A' //and typecast to integer value for (int i = 1; i < str.length(); i++) { if(!(str.charAt(i)==' ')){ sb.append(str.charAt(i)); }else{ //skipping space and convert next char to upper case and increment so that it won't print again sb.append((char)(str.charAt(i+1) -'a'+'A')); // same as above comments. i++; } } return sb.toString(); }
@SarangHoley
@SarangHoley 2 жыл бұрын
Thanks Naveen for Covering the Multiple Checks concept in the video 👍😊
@umeshjoshi8047
@umeshjoshi8047 2 жыл бұрын
Thanks @Naveen AutomationLabs for video . What if there is more than one space between two words of String [E.g:- String s="naveen automations labs" ] if we apply this check in for loop we can cover above case also if(word.length()>0){ //logic of converting first letter of word to captial and appending to result string; }
@naveenautomationlabs
@naveenautomationlabs 2 жыл бұрын
it can be easily handled by using \\s+. String words[] = str.split("\\s+");
@hakimakbary65
@hakimakbary65 2 жыл бұрын
Hi Naveen, Any plans to do series on XCUITest and locators in this framework? Please 😄
@sphanindra5981
@sphanindra5981 2 жыл бұрын
Please tell how to solve this type of string string s= 2**7***9; output like 2357859
@sunitasenapati6569
@sunitasenapati6569 2 жыл бұрын
Hii is there any online course is available in your lab..???
@Ram_5
@Ram_5 2 жыл бұрын
Hi Naveen, Can you please tell me solutions for the question in the below. Split a String but don't split when character repeats.. input s="aHHHbYY"; Out put would be like output:[a, HHH, b, YY] Thanks in advance. Ragards, Kanvitha
@gagans.rgowda5820
@gagans.rgowda5820 Жыл бұрын
public static String[] split_string(String str) { String res =""; for(int i=0; i
@foddiebyage9696
@foddiebyage9696 2 жыл бұрын
Sir pls serialization in java, logging, monitoring or apps
@immortalhuman7085
@immortalhuman7085 2 жыл бұрын
What if interviewer asks not to use any String method like toUpperCase()
@Savin.Shetty
@Savin.Shetty 2 жыл бұрын
Capture string in in char array, iterate through the array. Get ASCI value of each char subtract that with 32 your will get you upper case ASCI value, that's it. Same works the other way round, as A - 65 and a - 97, rest follows.
@sureshgarine
@sureshgarine 2 жыл бұрын
hi @sameer, please see my solution in the comments above. I did more efficiently
@sureshgarine
@sureshgarine 2 жыл бұрын
@@Savin.Shetty I did the same :)
@immortalhuman7085
@immortalhuman7085 2 жыл бұрын
@@sureshgarine your comment not visible bro.
@sureshgarine
@sureshgarine 2 жыл бұрын
@@immortalhuman7085 can you please see, i can see it. check with in 1 hr
Method Overloading with byte,short,int,long,Integer parameters
4:18
Naveen AutomationLabs
Рет қаралды 6 М.
How Much Tape To Stop A Lamborghini?
00:15
MrBeast
Рет қаралды 217 МЛН
Twin Telepathy Challenge!
00:23
Stokes Twins
Рет қаралды 103 МЛН
風船をキャッチしろ!🎈 Balloon catch Challenges
00:57
はじめしゃちょー(hajime)
Рет қаралды 95 МЛН
#20 - Difference between Synchronization and ASynchronization Calls With Examples
18:28
Capitalize first letter of each word using java
13:04
Automation Hub Software Testing
Рет қаралды 20 М.
How to convert lowercase Strings to uppercase in Java | Strings Programming  tutorials | Part 1
9:28
ABC - Technology Training & Upskilling
Рет қаралды 43 М.
Testing Mock interview - 4+ Years of Experience (US Candidate) - Manual + Automation
1:15:00
String Immutable In Java Interview Question
9:47
Naveen AutomationLabs
Рет қаралды 21 М.
Capitalize The First Letter of a String in Java #30
9:23
Alex Lee
Рет қаралды 40 М.
Difference between Interface and Absract Class
30:52
Naveen AutomationLabs
Рет қаралды 182 М.
How Much Tape To Stop A Lamborghini?
00:15
MrBeast
Рет қаралды 217 МЛН