I B4A version13 , I search the library Under the AnywhereSoftware folder. I can't find it.StringBuilder it's a Core function.
Simply declare something like
and it will work in B4A, B4J and B4i.B4X:Dim sb as StringBuilder
It does not need any library to be ticked.
There is no library for it.I B4A version13 , I search the library Under the AnywhereSoftware folder. I can't find it.
There isn't StringBuilder.jar
Close the project and open it again, then try it againWhy my project still has error code?
Why my project still has error code?
Dim MyTargetMoney As String="1234.75"
If MyTargetMoney.Contains(".") Then
'''Dim arrNum(2) As String =sf.Split(MyTargetMoney,".")
Dim arrNum() As String = Regex.Split("\.", MyTargetMoney)
'// บาท
strBaht =arrNum(0)
'// สตางค์
strStang= arrNum(1)
Log(strBaht & " บาท, " & strStang & " สตางค")
End If
Waiting for debugger to connect...
Program stared.
1234 บาท, 75 สตางค
No only close the project but close computer ,it still be errored I think I will reinstall B4A againClose the project and open it again, then try it again
I will reinstall B4A again
I'm downloading B4A, Perhaps my problemwill be solved. Thank you all of you.If it still be error.I think I try to create a small libraryfor test again.Seems a bit extreme.
Did you try make your own StringBuilder library, to replace the StringBuilder that is built-in (Core) to B4X?
Maybe get rid of that first.
For what it's worth: I have both B4J and B4A installed and working, and there is no StringBuilder.jar file on any of my drives.
Would you mind sending me your sourcecode. I don't understand your word "Replace the stringbuilder that is built-in(core) to B4X" how I doEquivalent Core function Regex.Split works fine:
(plus note that you don't need to specify array size eg what would happen for MyTargetMoney "1.2.3" ? )
B4X:Dim MyTargetMoney As String="1234.75" If MyTargetMoney.Contains(".") Then '''Dim arrNum(2) As String =sf.Split(MyTargetMoney,".") Dim arrNum() As String = Regex.Split("\.", MyTargetMoney) '// บาท strBaht =arrNum(0) '// สตางค์ strStang= arrNum(1) Log(strBaht & " บาท, " & strStang & " สตางค") End If
Log output:Waiting for debugger to connect... Program stared. 1234 บาท, 75 สตางค
Would you mind sending me your sourcecode.
Sub AppStart (Args() As String)
'''Log("Hello world!!!")
Dim MyTargetMoney As String="1234.75"
If MyTargetMoney.Contains(".") Then
'''Dim arrNum(2) As String =sf.Split(MyTargetMoney,".")
Dim arrNum() As String = Regex.Split("\.", MyTargetMoney) 'use Regex.Split to split one big string into smaller strings
'// บาท
strBaht =arrNum(0)
'// สตางค์
strStang= arrNum(1)
Dim sb As StringBuilder 'use StringBuilder to join many small strings into one big string
sb.Initialize
sb.Append(strBaht)
sb.Append(" บาท, ")
sb.Append(strStang)
sb.Append(" สตางค")
Log(sb.ToString)
End If
End Sub
Waiting for debugger to connect...
Program started.
1234 บาท, 75 สตางค
Program terminated (StartMessageLoop was not called).
That thread is from 2017.I think my problem alike his problem
Thread 'Library CsBuilder !!' https://www.b4x.com/android/forum/threads/library-csbuilder.81178/
I don't understand your word "Replace the stringbuilder that is built-in(core) to B4X" how I do
Did you try make your own StringBuilder library, to replace the StringBuilder that is built-in (Core) to B4X?
Dim sf as B4XStringFunctionVb
sf.initialize
Dim arrNum()As String=sf.Split2(MyTargetMoney, ".")
Yes, I have already created Split2 addition., but I still be occured error.The function need to return an array instead of list.