c# - How to rewrite a string by pattern -
I have a string where "special areas" are attached in a crisp brace:
{IntIncG} / {intIncD} / 02- {yy}
I need these through all these elements and they have to change based on their content. What is the best code structure to do in C #?
I can not just change one place because I need to know the indicator of each "special area {}" so that the value to change it correctly.
reggax rgx = new reggae (@ "\ ({[^ \}] * \ }) "); String Output = RGX Replay (input, new matchualumer (dustfum)); Stable string DoStuff (match match) {// Here you have access to the match. Indexes, and matches Value can do something different for match 1, match 2, etc. // You can easily close the value by string. Value = match. Value Sebstring (1, match value.length -2); // Then call a function, which takes value and index to be the string to be subscribed}
Comments
Post a Comment