T
T
Tanyel2020-05-28 20:16:28
Regular Expressions
Tanyel, 2020-05-28 20:16:28

How to remove line break character \n in regular expressions?

There is a function that replaces the content in a tag with other content.
But if there is a line break character \n in the content, then the function stops working.

public static string zamLang (string str, string id) {
  string returnString = Regex.Replace(str, "(?<=<size>).*?(?=</size>)", Lang.lang(id));  
  return returnString;
}


For example if
string str = "Первая строка \n Вторая строка"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2020-05-28
@Tanyel

RegexOptions.Singleline

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question