string

  1. E

    B4J Code Snippet Compare text strings

    Written last century, resurrection prompted by related question in Spanish forum It is a very nice algorithm, even if I do say so myself. 🍻 Dim S1 As String = "Now is the time for all good men to come to the aid of the party" Dim S2 As String = "It was the time for good women to come to the...
  2. R

    Android Question What is the fastest way to split this string?

    Moving data from a text file to SQLite database. If I have a line in the text file like for example this: 123, "John,", Smith Then what would be the fastest way to split this line in these 3 fields: 123 John, Smith As these files can be large, I need to process the file line by line, so I...
  3. carlos7000

    Spanish Cadenas concatenadas Vs Cadenas interpoladas

    A veces encuentro cĂłdigo con lĂ­neas algo asĂ­ Hoy estuve investigando sobre el uso de las cadenas interpoladas, pero no me quedo claro. Por lo que le pedĂ­ a Chatgpt que me explicara su uso. Dejo este texto como ayuda a otros, porque hoy si aprendĂ­ como de emplean y lo uitiles que son las...
  4. carlos7000

    Spanish Problema al extraer datos de una lista. [Solucionado]

    Hola a todos. Estoy tratando de pasar parte del contenido de un archivo csv a una base de dato sqlite. Para ello escribĂ­ una funcion de prueba. Este es el cĂłdigo. Public Sub CargaDatos Dim SU As StringUtils Dim AirPorts As List = SU.LoadCSV(File.DirAssets, "ejemplo.csv", ",")...
  5. MList

    Android Question Define String with a certain length

    Hi, Is there any way to define a string with a certain length ? Like in Visual Basic reserved as string * 3 => length = 3 I have big data coming in as Hex String, it woud be much easier to handle with a structure of certain string length. VISUAL BASIC Public Type flagstringstruct 'Value...
  6. R

    Android Question Converting object to string

    I can do this with something like this: Sub CStr(oVal As String) As String Return oVal End Sub [\CODE] This is fine if oVal has a string assigned to it, eg: oVal = "abc" However, this won't work if oVal has nil assigned to it, so for example: [CODE] Dim o As Object Log(CStr(o)) [\CODE]...
  7. epiCode

    Android Code Snippet Detect Language of String from Unicode Characters

    Different languages use different Unicode Ranges to display their characters. Based on these ranges we can assume the Language/Script of a string. Sub identifyLang(text As String) As String Dim lang = "Unknown" Dim code As Int = Asc(text) Select True Case code >=...
  8. M

    iOS Question Convert String representing bytes in actual bytes

    Hi everyone... i've this string 0x33303a43363a46373a30303a39353a3641 that represents some bytes.. how can i transform it in actual bytes? i tried with for loops, byteconverter, arrays etc... nothing works like I need...
  9. Guenter Becker

    Android Question Image to/from CVS File

    Hello, I have 3 table columns named "ColA", ColB" and "ColC" where ColC is type BLOB and I like to store and read images in/from it. For a solution I like to export these table columns to a CVS File or import the CVS file values to the table columns. I know how to convert the image to a byte...
  10. santook

    B4R Question How to convert string to b4rstring?

    I want to convert string to b4rstring, for example, to use the JSON Library in inline C. But the following code seems to be wrong. MCU is constantly reset. Sub Process_Globals Public Serial1 As Serial Type TestC(A1 As String,A2 As Byte) End Sub Private Sub AppStart...
  11. R

    Android Question Saving Default String Data Containing CRLF

    Since before KVS was born I have saved default field data by assigning each field to a List element then saving to file with File.WriteList() Apparently that does not work when the string data contains CRLF because the line are divided up and added as individual list elements. So I gave KVS a...
  12. J

    Android Question Convert Double with Enum to String

    I have a long number from database. The number is 100000000 I need yo do some mathematics operation When I put it into Double, its turn into 1.0E8. After I've done with the mathematics operation, I need to convert the number into string. But it still retain 1.0E8 format. How do I change it back...
  13. Pedro Caldeira

    Android Question Use formula in string to calculate

    Hello guys, Is there any way to perform a calculation with the elements in a string for instance, i have "2x10/20" it can be any other calculus, like "(234/403)-20*50" but they are string can I somehow convert them to numbers to perform the operations ? Thanks
  14. M

    iOS Question String with two dimension different behavior between b4i and b4j

    Hello, I have defined a string variable with 2 dimensions. If I execute this code in B4i I get a different result like in b4j. I would expect the same result in b4i as in B4j. Can someone explain me what I am doing wrong? dim lv_array(2,2) as string lv_array(0,0) = "containername"...
  15. M

    Bug? SmartString compiler bug (?)

    Hi everyone, i was using the UDPSocket to send some packets to my server. I noticed something weird, if i try to compile my code the compiler crashes saying: Sub Button1_Click For i=0 To 100 UDPSocket1.Initialize("UDP", 0, 2048) Dim Packet As UDPPacket Dim...
  16. S

    Android Question Save settings common across multiple applications

    I'm having a hard time grasping how to save settings that are shared by multiple applications. Like let's say I have a company that has 5 applications and I want my users to login to just one of them, but maintain login across all 5. I know how to process login. I know how to save a map to a...
  17. Eric McDonald

    Android Question Using Searchview to capture String

    Hello all, Fairly new to B4A, so this may be a simple question... but it's got me stumped. I am using a SearchView as found in the SearchViewExample (found on the forum). However, I am having difficulty implementing it into my own code. What I wish to do is take the selected text (from the...
  18. F

    Android Question [SOLVED]Very Slow Loop

    I have a for-loop where I fill with data a string variable (that I have already Created). It takes 6 to 10 secs to complete. Log($"BEFORE loop- $time{DateTime.Now}"$) Dim n As Int = crs.RowCount - 1 Dim lvHtml As String = $"<!DOCTYPE...
  19. P

    B4J Question String parse

    Hi Everyone! Gotten stuck trying to receive some data from a post request and put it into a database, I get data like this; 'PIRTIMEOUT 001306894=5000' I need to put the 5000 (**** in the code)part into the database the other number being the device number (Num, in the code) it has to go...
  20. D

    Android Question String comparison

    Hi, Guys I have a problem with string comparison, the line IF fcmToken = webFcmToken then always fails (see code below). I have viewed tokens with in debug an they appear identical. Also tried .trim and even .toupper but still failed the comparison. Also tried fcmToken.compare(webFcmToken) and...
Top