fifiddu70 Well-Known Member Licensed User Longtime User Dec 5, 2012 #1 I have an EditText with the text and a euro amount, I need to extrapolate the amount and display it on another EditText, via a button, how do I? Code: Copy Sub btneuro_Click ?????????? help End Sub
I have an EditText with the text and a euro amount, I need to extrapolate the amount and display it on another EditText, via a button, how do I? Code: Copy Sub btneuro_Click ?????????? help End Sub
K kickaha Well-Known Member Licensed User Longtime User Dec 5, 2012 #2 what is the format of the text Upvote 0
mc73 Well-Known Member Licensed User Longtime User Dec 5, 2012 #3 Decide upon the separation character (which character special or not separates your text from your value) and use regex.split (though it can be done in different ways too). Here's the documentation of regex. Upvote 0
Decide upon the separation character (which character special or not separates your text from your value) and use regex.split (though it can be done in different ways too). Here's the documentation of regex.
fifiddu70 Well-Known Member Licensed User Longtime User Dec 6, 2012 #4 are in serious trouble, I can not figure out how to run my application, I have a textbox ( textboxdescription.text )with the following text: burger € 2.00 I want to take this textbox only the cost and display it in another textbox (textboxeuro.text )but I have not figured out how to deal with Regex.Split can someone give me an example? I tried in this way but I can not get it to work Code: Copy Sub btneuro_Click if textboxdescription.text.contains("€") then textboxeuro.text = textboxdescription.text.endswith("€") end if End Sub not work, help I realize that is not the exact code to extrapolate the cost and display it in textbox.euro Upvote 0
are in serious trouble, I can not figure out how to run my application, I have a textbox ( textboxdescription.text )with the following text: burger € 2.00 I want to take this textbox only the cost and display it in another textbox (textboxeuro.text )but I have not figured out how to deal with Regex.Split can someone give me an example? I tried in this way but I can not get it to work Code: Copy Sub btneuro_Click if textboxdescription.text.contains("€") then textboxeuro.text = textboxdescription.text.endswith("€") end if End Sub not work, help I realize that is not the exact code to extrapolate the cost and display it in textbox.euro
fifiddu70 Well-Known Member Licensed User Longtime User Dec 6, 2012 #5 the textboxdescription.text.contains (€) Upvote 0
klaus Expert Licensed User Longtime User Dec 6, 2012 #6 This code will do it: Code: Copy Sub btneuro_Click Dim i As Int i = textboxdescription.Text.IndexOf("€") If i >= 0 Then textboxeuro.Text = textboxdescription.Text.SubString2(i + 2, textboxdescription.Text.Length) End If End Sub The code assumes that there is always a blanc character between € and the cost. The code checks if there is a € character and if yes extracts the end of textboxdescription.Text beginning two characters after €. Best regards. Upvote 0
This code will do it: Code: Copy Sub btneuro_Click Dim i As Int i = textboxdescription.Text.IndexOf("€") If i >= 0 Then textboxeuro.Text = textboxdescription.Text.SubString2(i + 2, textboxdescription.Text.Length) End If End Sub The code assumes that there is always a blanc character between € and the cost. The code checks if there is a € character and if yes extracts the end of textboxdescription.Text beginning two characters after €. Best regards.
fifiddu70 Well-Known Member Licensed User Longtime User Dec 6, 2012 #7 thanks klaus, return from work tonight to try your example. Upvote 0
fifiddu70 Well-Known Member Licensed User Longtime User Dec 6, 2012 #8 thanks klaus, your example works fine, now I've got another request, but do it in a new post. Upvote 0