Android Question StringBuilder libraries

Theera

Well-Known Member
Licensed User
Longtime User
Refer to this ,Where can I get StringBuilder libraries for B4A,B4J,and B4i? Ithink B4Aversion13 there isn't thelibrary
 
Last edited:

Sagenut

Expert
Licensed User
Longtime User
StringBuilder it's a Core function.
Simply declare something like
B4X:
Dim sb as StringBuilder
and it will work in B4A, B4J and B4i.
It does not need any library to be ticked.
 
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
StringBuilder it's a Core function.
Simply declare something like
B4X:
Dim sb as StringBuilder
and it will work in B4A, B4J and B4i.
It does not need any library to be ticked.
I B4A version13 , I search the library Under the AnywhereSoftware folder. I can't find it.
There isn't StringBuilder.jar
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
I B4A version13 , I search the library Under the AnywhereSoftware folder. I can't find it.
There isn't StringBuilder.jar
There is no library for it.
It's included in the Core library that is always ticked as default.
strbui.jpg

Try writing something like in this image and you will find it in the suggestions.
I used "sb" as StringBuilder abbreviation, but you can declare the variable with any name you like of course.
 
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
Why my project still has error code?
 

Attachments

  • error.png
    error.png
    6.9 KB · Views: 1
  • TestB4XStringFunctionVB2.zip
    18.6 KB · Views: 0
Upvote 0

emexes

Expert
Licensed User
Why my project still has error code?

Equivalent 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 สตางค
 
Upvote 0
Top