比如把MO2405-P-5100中的MO和2405分开,保存到不同的字符串中,谢谢!
分别测试了 MO2405-P-5100 && M405-P-5100
木有问题
自己再改改吧
//这个不难吧?自己再根据实际需要改改
String StrSource(\"MO2405-P-5100\");
String TempStr(\"\");
String TempSymbol(\"\");
String TempTime(\"\");
Integer i;
If (FindFirstOf(StrSource, \"P\") >= 0)
Print(\"PutOption\");
Else
Print(\"CallOption\");
i = FindFirstOf(StrSource, \"-\");
StrSource = Left(StrSource, i);
Print(StrSource);
TempStr = Mid(StrSource, 1, 1);
If(TempStr >= \"0\" && TempStr <= \"9\")
{
TempSymbol = Left(StrSource, 1);
Print(\"Symbol: \" + TempSymbol);
TempTime = Right(StrSource, Len(StrSource) - 1);
Print(\"Time: \" + TempTime);
}
Else
{
TempSymbol = Left(StrSource, 2);
Print(\"Symbol: \" + TempSymbol);
TempTime = Right(StrSource, Len(StrSource) - 2);
Print(\"Time: \" + TempTime);
}
这种函数目前没有,只有left按照字符数量截取这样的函数。如果字符都是固定的,那么也许可以通过截取固定数量来拆开