2008-10-08 46 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))