void web_reg_save_param_custom(char *sourceStr, char* outpuStr, char *leftBdry, char *rightBdry){ char *st1, *st2; int result, i = 0; i=strlen(leftBdry); st1 = (char*) strstr(sourceStr, leftBdry); if (st1 != NULL){ st1 += i; st2 = (char*) strstr(st1, rightBdry); if (st2 != NULL){ result = st2 - st1; *(st1 + result) = '\0'; } } if ((st1 == NULL) || (st2 == NULL)) lr_error_message("Error: No substring found for the specified boundary"); else lr_save_string(lr_eval_string(st1), outpuStr); }Action(){ lr_save_string("xyzToken3234344endKey,","test"); web_reg_save_param_custom(lr_eval_string("{test}"), "Outputtest", "Token","endKey"); lr_output_message("切割后的值=%s",lr_eval_string("{Outputtest}")); return 0;}
深圳湖北籍软件测试群 275212937