Is there any reason why a label doesn't display text as it comes in? I retrieve data from a MySQL database, but when I display the text in the label there are no line breaks?
I could add them manually, but really shouldn't have to. Also the same database feeds my website, so I would have to change that as well if I started adding control characters.
Hi Erel, thanks, but this doesn't help as I have one variable (text) from my database as a description with line breaks in it. I have searched arounf beforehand on the forum and found this, but nothing that does what I need.
Did you try RegEx function. Perhaps something like:
B4X:
Dim strDB As String 'String from MySQL database
Dim strSplit() As String = Regex.Split("YOUR PATTERN HERE", strDB)
For i=0 To strSplit.Length-1
Label1.text=strSplit(i) & CRLF
Next
The problem is most probably in the server response. Try to save the string to a text file (File.WriteString) and then upload the text file to the forum.
I've deleted your post from the other thread as the other thread is two years old and it is clear that the problem is in the string and not in File.WriteString or Label.Text.
Please upload the text file. Maybe it uses a different end of line character.