regexWed, 01 Mar 2023

in C# how remove all symbols and whitespaces from start and end

var regex = new Regex("^\\s+|\\s+$"); string str = regex.Replace(" hello world ", "");

Questions about programming?Chat with your personal AI assistant