Selenium Real time Interview Questions || Swap two Strings without using temp/third variable

Published: 08 August 2022
on channel: Selenium Automation Testing
521
11

Swap two Strings without using temp/third variable:

Algorithm:

1) Append second string to first string and
store in first string:
a = a + b

2) call the method substring(int beginindex, int endindex)
by passing beginindex as 0 and endindex as,
a.length() - b.length():
b = substring(0,a.length()-b.length());

3) call the method substring(int beginindex) by passing
b.length() as argument to store the value of initial
b string in a
a = substring(b.length());
======================================================
Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:    / @seleniumautomationtesting7617  
=======================================================
Selenium Framework with Page Object Model | E-Commerce Project
   • Selenium Framework with Page Object Model ...  
=========================================================


On this page of the site you can watch the video online Selenium Real time Interview Questions || Swap two Strings without using temp/third variable with a duration of hours minute second in good quality, which was uploaded by the user Selenium Automation Testing 08 August 2022, share the link with friends and acquaintances, this video has already been watched 521 times on youtube and it was liked by 11 viewers. Enjoy your viewing!