Introduction
In this article I will explain how to find a substring from a string and if present then reverse the substring. Basically it is a frequently asked interview question. I have encountered this question many times in interviews. That is why I decided to write this article.
Now use the following procedure to implement it.
Step 1
First of all you have to create a new Windows Store Application, as in:
- Open Visual Studio 2012
- "File" -> "New" -> "Project..."
- Choose "Template" -> "Visual C#" -> "Window Store app"
- Choose "Blank App (XAML)" then rename the application

Step 2
Write the following XAML code in "Mainpage.Xaml" (that is available in Solution Explorer):
<Page
x:Class="number_app.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:number_app"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="Red">
<Grid.RowDefinitions>
<RowDefinition Height="116*"/>
<RowDefinition Height="60*"/>
<RowDefinition Height="52*"/>
<RowDefinition Height="48*"/>
<RowDefinition Height="40*"/>
<RowDefinition Height="53*"/>
<RowDefinition Height="310*"/>
<RowDefinition Height="89*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="328*"/>
<ColumnDefinition Width="353*"/>
<ColumnDefinition Width="685*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Enter string :" FontSize="20" FontWeight="ExtraBold" FontFamily="Arial" Grid.Column="1" Grid.Row="2" ></TextBlock>
<TextBox x:Name="textbox1" Grid.Column="2" Grid.Row="2" Width="200" Height="32" HorizontalAlignment="Left" VerticalAlignment="Top"></TextBox>
<TextBlock Text="Enter string :" FontSize="20" FontWeight="ExtraBold" FontFamily="Arial" Grid.Column="1" Grid.Row="2" ></TextBlock>
<TextBlock Text="Enter substring for Reverse :" FontSize="20" FontWeight="ExtraBold" FontFamily="Arial" Grid.Column="1" Grid.Row="3" ></TextBlock>



Join the conversation! Your thoughts help the community grow.