I have a native code snippet that I am going to write in managed code instead.
The native snippet code look like this:
std::string RClammer = "]";
std::string BigLine = "aaaaaaaa]aaaa";
int pos = 0;
while(std::string::npos != (pos = BigLine.find(RClammer, pos)))
{
BigLine.insert(pos + 1, " ");
pos = pos + 2;
}
My attemt to write that in managed code look like below but the application just "freeze" when I run this code, so I might beleive I am doing something wrong but dont know all logics of what I am doing excactly ?
I think it has to do something with ::npos that I dont get right ?
String^ RClammer = "]";
String^ BigLine = "aaaaaaaa]aaaa";
int pos = 0;
while(BigLine->Length != (pos = BigLine->IndexOf(RClammer, pos)))
{
BigLine.Insert(pos + 1, " ");
pos = pos + 2;
}