Android Code Snippet [B4X] Greedy Trim

StephenRM

Member
Replaces all multiple spaces / tabs (whitespaces) to single space in a string

B4X:
Sub greedyTrim (Text As String) As String
    If Text = "" Then Return Text Else Return Regex.Replace("\h+",text," ")
End Sub

This solves most of the problems even SQLite (Full Text Search)

Thankyou!
 
Top