1. Alexander Stolte

    Android Code Snippet [B4X] Count Regex Matches

    Sub CountMatches(text As String,pattern As String) As Int Dim tmp_count As Int = 0 Dim Matcher1 As Matcher Matcher1 = Regex.Matcher(pattern, text) Do While Matcher1.Find tmp_count = tmp_count +1 Loop Return tmp_count End Sub
  2. R

    Android Code Snippet Group and count Recordset (or list or array etc.)

    Needed a fast way to take a recordset and group and count a specified column, so that is get the unique items of that column and count the occurrences of all those unique items. This the best I could come up with: Sub GroupAndCountRS(RS1 As ResultSet, iColumn As Int) As Map Dim i As Int Dim...
  3. Alexander Stolte

    Android Code Snippet [B4X] Automatically increment file names

    Hey, if you download a file with Google Chrome for example and you have you've already downloaded this one time, then a number will appear next to it. This is now easy possible with this peace of code. checkfilename(File.DirDefaultExternal,"mytestname.jpg",0,"mytestname.jpg") Sub...