string func getStringByBoundaries(source3, b1, b2)
string source3, b1, b2;
{
int startPos, endPos;
startPos = strstr(source3, b1);
if (0 == startPos) {
return "";
}
startPos += strlen(b1); endPos = strstr(substr(source3, startPos, strlen(source3)), b2);
if (0 == endPos) {
return "";
}
return substr(source3, startPos, endPos - 1);
}
string func getStringByPrefixAndBoundary(source4, prefix, b3)
string source4, prefix, b3;
{
int startPos2, endPos2;
startPos2 = strstr(source4, prefix);
if (0 == startPos2) {
return "";
}
endPos2 = strstr( substr(source4, startPos2 + strlen(prefix), strlen(source4)), b3);
if (0 == endPos2) {
return "";
}
return
substr(source4, startPos2, strlen(prefix) + endPos2 - 1);
}
string func getStringByBoundaryAndPostfix(source5, b4, postfix)
string source5, b4, postfix;
{
int startPos3, endPos3;
startPos3 = strstr(source5, b4);
if (0 == startPos3) {
return "";
}
startPos3 += strlen(b4);
endPos3 = strstr(
substr(source5, startPos3, strlen(source5)), postfix);
if (0 == endPos3) {
return "";
}
return
substr(source5, startPos3, strlen(postfix) + endPos3 - 1);
}
string func getStringByPrefixAndPostfix(source6, prefix2, postfix2)
string source6, prefix2, postfix2;
{
int startPos4, endPos4;
startPos4 = strstr(source6, prefix2);
if (0 == startPos4) {
return "";
}
endPos4 = strstr(
substr(source6, startPos4 + strlen(prefix2), strlen(source6)),
postfix2);
if (0 == endPos4) {
return "";
}
return substr(source6, startPos4,
strlen(prefix2) + strlen(postfix2) + endPos4 - 1);
}
|