Sql fix '

buras3

Active Member
Licensed User
Longtime User
hello

i am trying to replace the ' char to char(96)
because it's making error when you have this char in a word

Sub FixStr(Word As String) As String
Dim NewWord As String
Dim Tav As Char
NewWord=""
For i =1 To Word.Length
Tav=Word.CharAt(i)
If Tav =Chr(34) Then
Tav=Chr(96 )
End If
NewWord=NewWord & Tav
Next i
Return NewWord
End Sub

I am getting the error:
NewWord=NewWord & Tav
javac 1.6.0_30
src\michael\CallStat\funcs.java:105: not a statement
_i;
^
1 error

what can i do?

tank you
 

klaus

Expert
Licensed User
Longtime User
You must replace
Next i
by
Next

Chr(34) is the character " double quote
Chr(39) is ' single quote

You can also write your routine like this :
B4X:
Sub FixStr(Word As String) As String
    Word = Word.Replace(Chr(34), Chr(96))
    Return Word
End Sub
Best regards.
 
Upvote 0
Top