2008-10-08 114 views

回答

0

不幸的是Lotus公式中沒有這樣的函數。你想做什麼? 有可能是另一種方式來做到這一點。

如果你真的需要的字符位置,雖然你可以這樣做:

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 
    ) 
); 
+0

下面還有更有效的答案。 Charles Ross給出的答案對我來說是最好的。 – andora 2018-03-09 23:00:20

1

信息搜索結果:= @左(SearchString在; 「C」); indexOf:= @ If(searchResult =「」; 0; @Length(searchResult)); 的indexOf

-1

@Length(SRC) - @Length(@ReplaceSubstring(SRC; SRCH; 「」))

+0

這樣做的結果將是字符串中與搜索匹配的字符數。它不會在字符串中提供字符的位置。 – molasses 2010-10-08 02:56:34

2

你可以使用@Left或@Leftback。我認爲在這種情況下他們的工作是一樣的。

src:= {your field value to search}; 
char:= {your target character}; 
indexof:= @Length(@Left(src;char))