Re: [Gambas-user] Function to count substrings

2017-09-13 Thread Gianluigi
Hi Rolf, I do not think it exists, but it can be done by myself. :-) As I wrote, I would do so: Private Function CountSubString(value As String, pattern As String, Optional compare As Integer) As Integer '' compare default Sensitive, 1 = Insensitive Dim i, n As Integer While i <= Len(value)

Re: [Gambas-user] Function to count substrings

2017-09-13 Thread Rolf-Werner Eilert
Thank you Luigi, This is what I had programmed myself (more or less). I just thought there might be a ready-made function like CountStr() or StrCtr() or something :) Regars Rolf Am 13.09.2017 11:01, schrieb Gianluigi: Sorry the link to see it work is this :-( https://gambas-playground.prok

Re: [Gambas-user] Function to count substrings

2017-09-13 Thread Gianluigi
Sorry the link to see it work is this :-( https://gambas-playground.proko.eu/?gist=d0fc775a24c00f2d5271865a565739ef Regards Gianluigi 2017-09-13 10:53 GMT+02:00 Gianluigi : > And something like that? > https://gist.github.com/anonymous/d0fc775a24c00f2d5271865a565739ef > > Regards > Gianluigi > >

Re: [Gambas-user] Function to count substrings

2017-09-13 Thread Gianluigi
And something like that? https://gist.github.com/anonymous/d0fc775a24c00f2d5271865a565739ef Regards Gianluigi 2017-09-13 10:04 GMT+02:00 Rolf-Werner Eilert : > Thanks Julio, > > good idea! - but: isn't this a bit too much? After all, you have to > instantiate a string[] for it each time, even th

Re: [Gambas-user] Function to count substrings

2017-09-13 Thread Rolf-Werner Eilert
Thanks Julio, good idea! - but: isn't this a bit too much? After all, you have to instantiate a string[] for it each time, even though you don't see it. Or am I wrong? At least when it has to be called many times (for a table like in my case). Regards Rolf Am 13.09.2017 09:32, schrieb Juli

Re: [Gambas-user] Function to count substrings

2017-09-13 Thread Julio Sanchez
Hi Rolf: "how many times does .." Maybe this may be worth this: count=split(mystring,chr$(10)).count Regards, Julio 2017-09-13 9:18 GMT+02:00 Rolf-Werner Eilert : > Hi folks, > > Somehow I don't remember this - wasn't there a function to count the > number of substrings occuring within a s