How to count number of semicolon in the Textbox fi

2019-08-21 16:07发布

Field A Value Is : Test1;Test2;Test3;Test4

I need to count number of semicolon present in Field A Like : 3

its possible to do this without coding?

标签: infopath
1条回答
\"骚年 ilove
2楼-- · 2019-08-21 16:45

Try this: Field A: Test1;Test2;Test3;Test4

Field B(default value): string-length(translate(FieldA, "1234567890ABCDEFGHIJKLMNOPQRSTVWXYZabcdefghijklmnopqrstuvwxyz", ""))

Result: 3

Translate function is to convert the other characters to blank(no space) and then using string-length to count the semicolons that are left.

EDIT: Created a blog post for this one for detailed explanation and steps.

查看更多
登录 后发表回答