DAY 5: ----- 1.String functions 2.Literal String 3.Non Literal String 4.Mutable String 5.Immutable String QUESTIONS(Theory) ------------------- 1.What is mean by string? 2.How to find length of the string? 3.How to find particular character in string? 4.How to split the string? 5.What is difference between literal String and non literal string? 6.What is mutable and immutable string? 7.Difference between stringbulider and stringbuffer? 8.Method name to identify memory location? 9.What are the string functions available in java? 10.What is difference between charAt() and contains() method? 11.What is the return type of compareTo() 12.Where the Literal String and non literal String stores? 13.What is mean by ASCII value? QUESTIONS(Programs) ------------------------------ QUESTION 1: ----------- Description: Find the length of the below string String 1: Automation Testing String 2: Information String 3: Tamilnadu String 4: j a v a p r o g r a m String 5: 987654321 QUESTION 2: ----------- Description: Find the particular character index in the given string String 1: welcometojava Find the last index of e String 2: SeleniumAutomationtool Find the index of m String 3: theatre Find the index of t String 4: j a v a p r o g r a m Find the last index of (emptyspace) String 5: 9876543210 Find the index of 8 Question 3: ----------- Description: Find the particular character in the given string String 1: SoftwareTestEngineer print the character e String 2: SeleniumAutomationtool print the character o String 3: Goodmorning print the character o String 4: j a v a p r o g r a m print the character p String 5: 9876543210 print the character 7 QUESTION 4: ----------- Description : Get two input from user and check the equality : print in the output whether it is Equal or not Example: -------- Input : String 1 : Java String 2 : Java Example: --------- Input : String 1 : Java String 2 : java Example: --------- Input : String 1 : Social media String 2 : SocialMedia Example(use equalsIgnoreCase): --------- Input : String 1 : Java String 2 : java Example(use equalsIgnoreCase) : --------- Input : String 1 : SeleniumTool String 2 : seleniumtool QUESTION 5: ------------ QUESTION 5.1: ------------ Description: Get the email id from the user and verify '@' is present or not? Example: ------------ Input = software643@gmail.com Output = valid email id QUESTION 5.2: ------------ Description:Get the address from the user and verify "pincode" is present or not? Example: ------------ Input = 3-53-2m,Balamurugan,Thanjavur Output = invalid address QUESTION 5.3: ------------ Description:Get the email from the user and verify '@' is present or not and return true or false? Example: ------------ Input = automation24@gmail.com Output = True/False QUESTION 5.4: ------------ Description:Get the phonenumber from the user and verify any character is present or not .If character is present return invalid number Example: ------------ Input = 9a654e2i0 Output = False QUESTION 6: ----------- Description:Get the phonenumber from the user . If phonenumber exceeds greater than 10 then return invalid number Example: -------- Input = 98765432101234 output = invalid Example 2: --------- Input = 9876543210 Output = valid QUESTION 7: ------------ QUESTION 7.1: ------------- Description:Given string as "Welcome to java class" and replace java into python. Example: ----------- Input = Welcome to class java output = Welcome to class sql QUESTION 7.2: ------------- Description:Given string as "Software Testing"and replace Software into Automation. Example: ----------- Input =Software Testing Output =Automation Testing QUESTION 7.3: ------------- Description: Given String as "Welcome to java class" and Replace space into '#' Example: ---------- input:Welcome to java class output:Welcome#to#java#class QUESTION 7.4: ------------ Description:Get the email from the user and verify "gmail" is present or not.If present replace that gmail into yahoo Example: ------------ Input = Testingtool24@gmail.com Output = Testingtool24@yahoo.com QUESTION 7.5: ------------ Description:Get the address from the user and verify "pincode" is present or not.If present replce the pincode with empty space Example: ------------ Input = 3-53-2m,Balamurugan,Thanjavur,pincode-613001 Output = 3-53-2m,Balamurugan,Thanjavur. QUESTION 8 ---------- QUESTION 8.1 ------------- Description:Get the input from the user and print that word in lowercase Example: -------- Input = Selenium Output = selenium QUESTION 8.2 ------------- Description:Get the input from the user and print that word in Uppercase Example: -------- Input = javaprogram Output = JAVAPROGRAM QUESTION 8.3 --------------- Description:Convert all small letter and into capital letter Example: ---------- Input = WelcomE Output = wELCOMe QUESTION 8.4 -------------- Description:Find the number of uppercase count and lowercase count in the given String Example: -------- Input = WelComeToJava Output: ------- UpperCase=4 LowerCase=9 QUESTION 9 ------------ QUESTION 9.1 -------------- Description: Given String as "Welcome to java class" and verify whether the given string startsWith welcome Example: ----------- Input = Welcome to class java output = True QUESTION 9.2 -------------- Description: Given String as "Selenium tool" and verify whether the given string startsWith welcome Example: ----------- Input = Selenium tool output = False QUESTION 9.3 -------------- Description: Given String as "Welcome to java class" and verify whether the given string endsWith class Example: ----------- Input = Welcome to java class output = True QUESTION 9.4 -------------- Description: Given String as "Welcome to java class" and verify whether the given string endsWith java Example: ----------- Input = Welcome to java class output = False QUESTION 9.5 -------------- Description: Given String as "Welcome to java class" and verify whether the string is empty or not Example: ----------- Input = Welcome to java class output = False QUESTION 9.6 -------------- Description: Given String as "" and verify whether the string is empty or not Example: ----------- Input = "" Output = False QUESTION 10 ----------- Description : Get two input from user and Compare Example --------- String 1 : programming String 2 : programming Example --------- String 1 : Programming String 2 : program QUESTION 11 ------------ QUESTION 11.1 --------------- Description : Generate the two literal string and find the identityHashCose() Example --------- String 1 : JAVA String 2 : JAVA QUESTION 11.2 --------------- Description : Generate the two non literal string and find the identityHashCose() Example --------- String 1 : selenium String 2 : selenium QUESTION 11.3 --------------- Description : Generate the three non literal string and find the identityHashCose() Example --------- String 1 : java String 2 : program String 3 : javaprogram QUESTION 11.4 --------------- Description : Generate the three literal string and find the identityHashCose() Example --------- String 1 : java String 2 : program String 3 : javaprogram QUESTION 12 ------------ QUESTION 12.1 -------------- Description: Given String as "Welcome to java class" and split it by space. Example: -------- Input :Welcome to java class Output: ------- Welcome to java class QUESTION 12.2 -------------- Description: Given String as "Welcome to java class" and split it by l Example: -------- Input :Welcome to java class Output: ------- We come to java c ass QUESTION 13 ------------ QUESTION 13.1 -------------- Description: Given String as "Welcome to java class" and generate a substring. Example: -------- Input :Welcome to java class Output: ------- Welcome QUESTION 14 ----------- Example: ----------- Description: Given String as "Welcome" and the number of consonant count and vowels count Example: --------- Input = Welcome output: ------- vowels = 3 consonant = 4 QUESTION 15: ------------ Description: Find the count of caps,small,number and special character in given string Example: ----------- Input : Welcome To Java class @123 Output ------ caps count :3 small count :15 number count:3 Special char:5 QUESTION 16 ------------ Description: Replace all vowels char into '@' Example: ---------- Input = Welcome Output = W@lc@m@