Answer Posted / sayan
Private Sub btnAnswer_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnevaluate.Click
Dim Input As String
If IsPalindrome(Input) Then
txtAnswer.Text = "True"
Else
txtAnswer.Text = "False"
End If
End Sub
Function IsPalindrome(ByVal Input As String) As Boolean
Dim Front As Integer
Dim Back As Integer
Dim Middle As Integer
Dim nPalindrome As Boolean
IsPalindrome = False
nPalindrome = True
Back = Input
Middle = Back / 2
Front = 1
If (Back < 1) Then
Exit Function
End If
Do While (Front <> Back And Front <= Middle)
If (Mid(Input, Front, 1) <> Mid(Input, Back, 1)) Then
nPalindrome = False
Exit Do
End If
Back = Back - 1
Front = Front + 1
Loop
IsPalindrome = nPalindrome
Exit Function
End Function
End Class
| Is This Answer Correct ? | 7 Yes | 6 No |
Post New Answer View All Answers
What are tuples c#?
What namespace is list in c#?
Does c# support properties of array types?
what optimizations does the c# compiler perform when you use the /optimize+ compiler option?
What do you mean by sealed classes and static classes?
What is deferred execution in c#?
What is the use of properties window?
What do u meant by "SBI" of an object?
Explain how can I get around scope problems in a try/catch?
Hi to all..I have to create an intranet application on C#.NET windows Application so please please let can you people help me as iam new in .NET and if u have any samples or website address from where i can get sample please let know.
Explain briefly the difference between value type and reference type?
What are sessions in c#?
What is the C# syntax to catch any possible exception?
How do I type a whitespace character?
What is c# used for in the industry?