2uzhan.com
Advertisement
Now Place:2uzhan.com » Word check

Word check

Software Development @ October 17, 2009   Views:0

Hello to all , is there any code that will make possible check if the user typed a word i want in order to show him something ?

something like , if the user types time , or tim or timing or the word time and transformated to show him up the time ..

Regards,
xVent

--------------Solutions-------------

I think you are talking about IF Else statements.
May be this code will help you ...

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox1.Text = "time" Or TextBox1.Text = "tim" Or TextBox1.Text = "now" Then
            TextBox1.Text = TimeOfDay
        ElseIf TextBox1.Text = "name" Or TextBox1.Text = "nam" Then
            TextBox1.Text = "VB.Net"
        ElseIf TextBox1.Text = "Age" Or TextBox1.Text = "age" Then
            TextBox1.Text = "10"
        End If

    End Sub

You can use AND like or.It will make you to check 2 conditions at the same time , that means it will run only if that 2 conditions are satisfied.

Try it ...
Best of luck ...

Thanks for the code but this will check if i have the word time only in the textbox .. i want it to check if a word for example "timezor" is in the textbox to understand the world time for example .. and it will continue to the write If or Sub ...

Use contains:

Public Class frmComplete
  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    ProcessString(TextBox1.Text)
  End Sub

  Private Sub ProcessString(ByVal s As String)
    If (s.Contains("time")) Then

    End If
  End Sub
End Class

thanks , ill try it

I'm attempting to simplify my fundraising page, and would like to show exactly how much each donation would help us out. I've listed the options below, but I would like ...

Write a java program that asks a person for his height (in meters) and weight (in kilograms) and
outputs one of the messages: underweight, normal, or obese, using the BMI ...

Before I get into the specific issues, I want to provide some other details:

  • Normally, I work on a live, paid server (even in dev); I realize that is ...
Tags:vb.net
© 2018 2uzhan.com Contact