C++ にタグを付けたので、次のようにしてみませんか。
#include <iostream>
#include <string>
#include <vector>
int main(int argc, const char * argv[])
{
std::vector<std::string> rowStr;
// Import your data however you need to, below is just for example
rowStr.push_back("000000000");
rowStr.push_back("000000000");
rowStr.push_back("00-2000000");
rowStr.push_back("000000000");
rowStr.push_back("000000000");
rowStr.push_back("000000000");
rowStr.push_back("00000-2000");
rowStr.push_back("000000000");
std::string subString("-2");
for (size_t r = 0; r < rowStr.size(); r++) {
std::string binaryStr = rowStr.at(r);
if (binaryStr.find(subString) != std::string::npos) {
size_t c = binaryStr.find(subString);
std::cout << "row = " << r << "; col = " << c << std::endl;
}
}
return 0;
}
出力は次のとおりです。
row = 2; col = 2
row = 6; col = 5