0
我有一些的SKU,我需要一個字母數字代碼,諸如D2 D3 D4等使用簡單的IF(lineVector [1] .find(「D2字符串查找(),用於findng小差異
IM者區分「))
但是當我用多條語句做這件事情時,它似乎落入第一條,如果不改變。我的問題是,發現是否看到了D,並決定它不需要審視它,因爲它找到了它。
任何建議
繼承人我的代碼在短期
if (lineVector[7].find("D2"))
{
tempQuantity = 2;
totalQuantity += tempQuantity;
}
else if (lineVector[7].find("D3"))
{
tempQuantity = 3;
totalQuantity += tempQuantity;
}
else if (lineVector[7].find("D4"))
{
tempQuantity = 4;
totalQuantity += tempQuantity;
}
else if (lineVector[7].find("D5"))
{
tempQuantity = 5;
totalQuantity += tempQuantity;
}
else
{
tempQuantity = 1;
totalQuantity += tempQuantity;
}