如何从Crystal
语法的字符串中提取最后一组括号(包括括号)中的文本?
字符串示例:
"Coaching (CG) and Mentoring (MG) (SST)"
结果应为:
(SST)
//我正在使用这个公式:
right({LMS_sch_Course_Table.NamePrimary},(len({LMS_sch_Course_Table.NamePrimary})-instr({LMS_sch_Course_Table.NamePrimary}," ("))+1)
// unfortunatley它给了我“(CG)和指导(MG)(SST)”
答案 0 :(得分:0)
试
Right("Coaching (CG) and Mentoring (MG) (SST)",5)
编辑---------------------------------------------- ------------------------------
Local Stringvar x:=databasefield;
Local Numbervar i;
Local Stringvar y;
Local Stringvar Array z:=(Split (x," "));
for i:=1 to count(z) do
(
if("(" in z[i])
then
y:=z[i]
);
y;