views:

706

answers:

3

I can't find this anywhere in the Domino Designer help. It seems so straightforward!

All I need to do is find the position of a character in a string.

A: 

Unfortunately there is no such function in Lotus Formula. What are you trying to do? There may be another way to do it.

If you really need the character position though you could do this:

REM {
    S  Source string
    F  Character to find
    R  Location of character in string or 0
};

S := "My string";
F := "t";
LEN_S := @Length(S);
R := 0;

@For(I := 1; I < LEN_S; I := I + 1;
    @If(@Middle(S; I; 1) = F;
        @Do(R := I; I := LEN_S);
        @Nothing
    )
);
molasses
+1  A: 

searchResult:=@Left(SearchString;"C"); indexOf:=@If(searchResult="";0;@Length(searchResult)); indexOf

A: 

@Length(src) - @Length(@ReplaceSubstring(src;srch;""))

david dickey
The result of this will be a count of characters in the string that match the search. It will not provide the position of a character within the string.
molasses