S strupp01 Active Member Licensed User Longtime User Jul 3, 2017 #1 Is there a library, z.B. 20 Space behind a string? Example: Ergebnis = Taste & space (20)
stevel05 Expert Licensed User Longtime User Jul 3, 2017 #2 It doesn't appear to be available as a utility in java. Try this: B4X: Public Sub StrRepeat(Str As String, Count As Int) As String Dim SB As StringBuilder SB.Initialize For i = 0 To Count - 1 SB.Append(Str) Next Return SB.ToString End Sub Use: B4X: Log("Test" & StrRepeat(" ",20) & "***") Upvote 0
It doesn't appear to be available as a utility in java. Try this: B4X: Public Sub StrRepeat(Str As String, Count As Int) As String Dim SB As StringBuilder SB.Initialize For i = 0 To Count - 1 SB.Append(Str) Next Return SB.ToString End Sub Use: B4X: Log("Test" & StrRepeat(" ",20) & "***")
K keirS Well-Known Member Licensed User Longtime User Jul 3, 2017 #3 Alternatively my library 90+String Manipulation Methods does it. B4X: Dim APSU As ApacheSU Ergebnis = Taste & APSU.Repeat(" ",20) Upvote 0
Alternatively my library 90+String Manipulation Methods does it. B4X: Dim APSU As ApacheSU Ergebnis = Taste & APSU.Repeat(" ",20)
S strupp01 Active Member Licensed User Longtime User Jul 3, 2017 #4 Thank you. But the first solution already installed in the program. Upvote 0