I got trouble to give space between words on sql, before on sql I already did on vb.net:
'============================= Create Space Between Words ========================'
'Split The Words into 3 line'
' Lang if 0 english else if 1 Indonesian'
Dim ReceiptTextWords As String() = receiptText.Split("+")
'================================== First Line ==================================='
' This is how the third line appears in the string array after the space splitting'
Dim ReceiptTextWord1 As String() = ReceiptTextWords(0).Split(" ")
' This array contains the spaces reserved for each word in the string array above'
If lang = "0" Then
' MM YY : 0610 REF. NO : 1234567890 R.WAHYUDIYONO,IR '
Dim spaces1 = New Integer() {3, 10, 2, 16, 5, 7, 2, 16, 29}
' Now loop on the strings and format them as indicated by the spaces'
' Attention, the value for space include the string itself'
Dim z As Integer = 0
For Each s In ReceiptTextWord1
sb.Append(s.PadRight(spaces1(z)))
z += 1
Next
ElseIf lang = "1" Then
' BL TH : 0610 NO REF. : 1234567890 R.WAHYUDIYONO,IR '
Dim spaces1 = New Integer() {3, 9, 2, 17, 3, 11, 2, 17, 29}
' Now loop on the strings and format them as indicated by the spaces'
' Attention, the value for space include the string itself'
Dim z As Integer = 0
For Each s In ReceiptTextWord1
sb.Append(s.PadRight(spaces1(z)))
z += 1
Next
End If
But right now I should do it on sql.
Right no on my stored procedure, I give the space manually and set in on char variable:
SET @ReceiptText = ' NO REF. : '+@RefNo+' MOHON SIMPAN STRUK INI , SEBAGAI BUKTI PEMBAYARAN YANG SAH '
I thought it's quite annoying, is there any solutions? Or what I've done on vb.net could resolve on sql?