Android Question This is how to search in access in Arabic with ignoring modulation. I want to convert the code to b4a search in SQlite

AlfaizDev

Well-Known Member
Licensed User
Longtime User
This is how to search in access in Arabic with ignoring modulation. I want to convert the code to b4a search in SQlite

B4X:
Public Function Gstr(str As String) As String

        Dim r As String = ""

        For Each c As Char In str

            r &= c & "%"

        Next

        Return r

End Function
 
Last edited:

AlfaizDev

Well-Known Member
Licensed User
Longtime User
B4X:
cmd = SQL1.ExecQuery("SELECT * FROM nsoos where SC like '%" &  Gstr (AutoCompleteEditText1.Text.Trim) &"%'")

The search code will look like this after correcting the function
 
Upvote 0

AlfaizDev

Well-Known Member
Licensed User
Longtime User
This is how to search in access in Arabic with ignoring modulation. I want to convert the code to b4a search in SQlite

B4X:
Public Function Gstr(str As String) As String

        Dim r As String = ""

        For Each c As Char In str

            r &= c & "%"

        Next

        Return r

End Function

Is it not possible to convert b4a?
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Is it not possible to convert b4a?
Are you looking for something like this:
B4X:
Log(Gstr("alfaiz"))   'returns : a%l%f%a%i%z%

Sub Gstr(str As String) As String
        Dim r As String = ""
        For i =0 To str.Length-1
            Dim c As Char= str.CharAt(i)
           ' r = r & c & "%"  'this one works too
             r =$"${r}${c}%"$    
        Next
        Return r
End Sub
Your question is not clear. Please clarify with an example if the above code does not answer your question.
 
Last edited:
Upvote 0

AlfaizDev

Well-Known Member
Licensed User
Longtime User
Are you looking for something like this:
B4X:
Log(Gstr("alfaiz"))   'returns : a%l%f%a%i%z%

Sub Gstr(str As String) As String
        Dim r As String = ""
        For i =0 To str.Length-1
            Dim c As Char= str.CharAt(i)
           ' r = r & c & "%"  'this one works too
             r =$"${r}${c}%"$   
        Next
        Return r
End Sub
Your question is not clear. Please clarify with an example if the above code does not answer your question.

thank you very much
 
Upvote 0
Top