Given two strings and . Create two new strings by exchanging the first half and second half of one of the strings with the first half and second half of the other string respectively.
Input : fighter warrior Output :warhter figrior Input :remuneration day Output :dration remuneay
In the first example, fighter is made up of two parts fig and hter. Similarly, warrior is also made up of two parts war and rior. Interchange the first part of both the strings to create two new strings warhter and figrior. Similarly, in the second example first part of remuneration which is remune is exchanged with the first part of day to create dration and remuneay.
- Check if both halves of the string have same set of characters
- Check if both halves of the string have same set of characters in Python
- Check if both halves of the string have at least one different character
- Create a new string by alternately combining the characters of two halves of the string in reverse
- Program to check if a String in Java contains only whitespaces
- Program to check if the String is Null in Java
- Program to check if the String is Empty in Java
- Check if one string can be converted to another
- Jaro and Jaro-Winkler similarity
- Number of binary strings such that there is no substring of length ≥ 3
- First substring whose reverse is a word in the string
- Program to check the validity of a Password
- Parsing String of symbols to Expression
- Check if a word is present in a sentence
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : manishshaw1