Use Regex in C# to insert spaces between ConcatenatedFileNamesLikeThis?

前端 未结 2 1041
再見小時候
再見小時候 2021-01-06 04:31

We\'re trying to generate user friendly looking report names from SSRS Report filenames, these can\'t have spaces in the name but it should be possible to generate them from

2条回答
  •  情书的邮戳
    2021-01-06 05:11

    Edit 2 fixed IEE

    var input = @"WeeklyIEEReportWC20090103SortedByDate";
    string p = @"(?<=[A-Z])(?=[A-Z][a-z])|(?<=[a-z0-9])(?=[A-Z])|(?<=[a-zA-Z])(?=[0-9])";
    string value = Regex.Replace(input, p, " ");
    

    produces Members Of IEE Team and Weekly IEE Report WC 20090103 Sorted By Date for the samples provided.

提交回复
热议问题