It's not that complex, except we can't tell you exactly what to do because we have no idea what your rules for the new value actually are, and your examples show two different possible rules.
But the essence is simple:
Find the data to replace, generate new value, replace.
You could use substring for this, but a Regex will do it probably easier:
private Regex getContent = new Regex(@"(?<=-L).+?(?=-W)");
private void MyButton_Click(object sender, EventArgs e)
{
string input = "MP-MS-BL-FO-L2000-W294";
Match m = getContent.Match(input);
string data = m.Value;
data = "XX" + data + "YY";
string output = getContent.Replace(input, data);
}