To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=76156 Issue #|76156 Summary|Counting number of substrings within a string Component|Spreadsheet Version|OOo 2.2 Platform|All URL| OS/Version|Windows 2000 Status|UNCONFIRMED Status whiteboard| Keywords| Resolution| Issue type|DEFECT Priority|P3 Subcomponent|code Assigned to|spreadsheet Reported by|discoleo
------- Additional comments from [EMAIL PROTECTED] Fri Apr 6 16:56:18 +0000 2007 ------- Unfortunately, Calc lacks even basic support for string functions (see my other issues on strings, like issue 66590). This makes the program unsuitable for any work that relies heavily on strings. One of the functionalities that I am missing is a function that counts the number of occurrences of a substring within a given string. Lets say, we have the string: "ab cd ab de", and we want to count how often "ab" occurs inside this string. I have included in the attached file the C++ code for a new function, ScInterpreter::ScFindCount(), that performs this task. This function counts the number of occurences of a given string within another string // - IF string is NOT found, it returns 0 // - otherwise it returns the number of occurences of the substring // - parameters: // 1. string: this is the search item // 2. string: this will be searched for the first string // 3. is overalpping of search results allowed: // - default: FALSE (NO) // 4. START position: default = begining of string (=1) // 5. END position: default = LEN(string) I noticed now, that the function will probably NOT recognise wildcards, so I will look forward to correct that. I hope that such a function will make it in the OpenFormula specification, too. --------------------------------------------------------------------- Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
