B bijou Member Licensed User Apr 13, 2017 #1 Hi i'm not a good programmer, so i'd like to know the best way to build this if condition. actually i'm doing this: Code: Sub ImageView2_Click If EditText1.Text="tala" Then Label2.Visible=True Else If EditText1.Text="tala " Then Label2.Visible=True Else If EditText1.Text="Tala" Then Label2.Visible=True Else Label2.Visible=False i'd like to di this if EditText1.Text= "tala" or "Tala " or ... then Label2.Visible=True also don't make difference between small letters and capital letters and if possible ignore space ?! Last edited: Apr 13, 2017
Hi i'm not a good programmer, so i'd like to know the best way to build this if condition. actually i'm doing this: Code: Sub ImageView2_Click If EditText1.Text="tala" Then Label2.Visible=True Else If EditText1.Text="tala " Then Label2.Visible=True Else If EditText1.Text="Tala" Then Label2.Visible=True Else Label2.Visible=False i'd like to di this if EditText1.Text= "tala" or "Tala " or ... then Label2.Visible=True also don't make difference between small letters and capital letters and if possible ignore space ?!
Erel B4X founder Staff member Licensed User Longtime User Apr 14, 2017 #2 Very short: Code: Label2.Visible = EditText1.Text.ToLower.Trim = "tala" Short: Code: If EditText1.Text.ToLower.Trim = "tala" Then Label2.Visible = True Else Label2.Visible = False End If Upvote 0
Very short: Code: Label2.Visible = EditText1.Text.ToLower.Trim = "tala" Short: Code: If EditText1.Text.ToLower.Trim = "tala" Then Label2.Visible = True Else Label2.Visible = False End If