OpenNTF.org - Lotus Script String Class
My Links (Not logged in)
Code Bin Search
 
Hosted by Prominic.NET
Rate This Code
5 - brilliant stuff
4 - very nice
3 - average
2 - needs work
1 - bad
   OpenNTF Code Bin
About This Code
Brief Description:
Lotus Script String Class 
Rating:
Rating: 2 , Number of votes: 1 
Contributor:
Pierre Koerber 
Category:
Lotusscript 
Type:
API Functions 
Document Release:
Notes Version:
R5.x, R6.x 
Last Modified:
25 Jan 2005 
OpenNTF Disclaimer

All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.

Code / Description
A simple lotus script class. I just took all the string function on the Code Bin db and aggregate them in a class... You can


'--- Public Method
Declare Public Function addText(szText As String) As String
Declare Public Function addNewLine() As String
Declare Public Function getValue() As String
Declare Public Function replaceSubstring(fromString As String, toString As String) As String
Declare Public Function justify(longChaine As Integer, caract As String) As String
Declare Public Function rightBack(searchString As String) As String
Declare Public Function leftBack(searchString As String) As String
Declare Public Function replaceLatinCharacter(szString As String) As String
Declare Public Function rright(searchString As String ) As String
Declare Public Function lleft(searchString As String ) As String

Usage / Example
Dim s As lsString

Set s = New lsString("Hello Wolrd")
Call s.replaceSubString("l", "X")
msgbox s.getValue()
Code Attachments
string.dxl (17 Kbytes)
 Comments
Posted by Michael Woehrer on 02/01/2005 04:05:33 PMThanks for your work, but ...
... there are some functions used which are available since R5.

rightBack ---> StrRightBack
leftBack ---> StrLeftBack
etc.
Regarding ReplaceSubstring: the function you use does not support arrays (what the original @ReplaceSubstring does). In addition, the replace function (available since ND6) is damn fast in comparison to the typical instr/mid algorithm which is usually used to realize a replacesubstring. My experience is that this ND6 replace function is more than 30times (or even more) faster than this typical used algorithm you use in your class (and I also use in R5 apps) for this matter.
 Add your comment!