Module Module1
Sub main()
Dim opt As Double 
Dim str,ch,n As String
Do
 Console.WriteLine("*******program to perform string functions********")
 Console.WriteLine("1.convert lowercase to uppercase")
 Console.WriteLine("2.string extraction from left")
 Console.WriteLine("3.string to perform length function")
 Console.WriteLine("4.string to perform reverse function")
 Console.WriteLine("5.string to perform left trim function")
 Console.WriteLine("6.string to perform replace function")
 Console.WriteLine("7.string to perform substring function")
 Console.WriteLine("8.string to perform concatenation function")
 Console.Write("Enter your choice:")
 opt=Console.ReadLine()
 Console.Write("Enter any string:")
 Str=Console.ReadLine()
 Select Case(opt)
   Case 1
     n=Ucase(str)
     Console.WriteLine("uppercase of the string is:" + n.Tostring)
   Case 2
     Console.Write("Enter the number of characters to extract from left:")
     n=Console.ReadLine() 
     Console.WriteLine(" "& n & "character(s) from the left is:" + Left(str, n))
   Case 3
      n=Len(str)
      Console.WriteLine("length of the string is:" + n.Tostring)
   Case 4
      Console.WriteLine("Reverse of the string is:" + strReverse(str))
   Case 5
      Console.WriteLine("Left trim of the string is:" + LTrim(str))
   Case 6
Dim Search, Replace As String
       Console.Write("Enter the string to be searched:") 
       Search=Console.ReadLine()
       Console.Write("Enter the string to be replaced:")
       Replace=Console.ReadLine()
       n=str.Replace(Search,Replace)
       Console.WriteLine("String after replacement is:" + n.Tostring)   
Case 7
       Dim x, y As Integer 
       Console.Write("Enter the start position to extract:")
       x=Console.ReadLine() 
       Console.Write("Enter the number of characters to extract:")
       y=Console.ReadLine()
       n=str.Substring(x, y)
       Console.WriteLine(str & "(" & x & " " & y & ")of the string is:" + n.Tostring)
    Case 8
       Dim secstr As String
       Console.Write("Enter the second string to concate:")
       secstr=Console.ReadLine() 
       n=String.Concat(str," ",secstr)
       Console.WriteLine("concatenated string is:" + n.ToString)
 End Select
 Console.Write("Do you want to continue (y/n):")
 ch=Console.ReadLine()
Loop While (ch.Equals("y") Or ch.Equals("Y"))
End Sub
End Module