VB.NET program that uses padding String
Module Module1
Sub Main()
' Format String.
Dim format As String = "{0,-10} {1,10}"
' Construct lines.
Dim line1 As String = String.Format(format, 100, 5)
Dim line2 As String = String.Format(format, "Carrot", "Giraffe")
Dim line3 As String = String.Format(format, True, False)
' Print them.
Console.WriteLine(line1)
Console.WriteLine(line2)
Console.WriteLine(line3)
End Sub
End Module
B4X:
Output
100 5
Carrot Giraffe
True False
as you can see the text is formated perfectly, first string of first line is to the left and second srting to the right
and all 3 lines are formated the same.
i would liek to do this with a LV singleline label.text, is this possible?
Yes, but you'll have to implement your own alignment methods (it's not hard, just choose a column width and add ColumnWidth-String.Length spaces with a StringBuilder before adding your String to the StringBuilder). Make sure to use a monospaced font in your View.
Yes, but you'll have to implement your own alignment methods (it's not hard, just choose a column width and add ColumnWidth-String.Length spaces with a StringBuilder before adding your String to the StringBuilder). Make sure to use a monospaced font in your View.
thanx a lot i allready figured out that what i was missing was the monospaced font, the problem is i am using hebrew font and i had no monospace font in hebrew thatswhy i did not get the result i wanted, but now i will try with a font i found (miriam_fixed) and hope it will work!