[=](int c){return c=='\n'||c==' ';}
is a lambda expression that creates an unnamed function object. It is callable with one parameter and returns a boolean. The square brackets are the so-called "lambda introducer" which contains the so-called "capture-clause". The capture-clause tells the compiler how the lambda object captures surrounding local variables.
std::replace_if(ln.begin(),ln.end(),[=](int c){return c=='\n'||c==' ';},0);
replace_if takes two iterators for a sequence, a functor (more specifically: a predicate) and some other value. It iterates over the elements of the sequence called ln
and replaces each element with 0 if the given predicate (the lambda expression) returns true for that element.
So, basically, this line of code will replace each space and line feed character in ln
with a null terminator.