Replacing variable length string with some word

前端 未结 2 2041
故里飘歌
故里飘歌 2021-01-03 17:03

Given the below string

Declare @string varchar(max)=\'abc ___________ deffns ___ cg _ hif _______hh ihs\';

this is the Output requi

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-03 17:36

    In C# you can use:

    string str = Regex.Replace(s, @"(_)\1{5,}", Lastname);
    

    It will match character _ if more than 5 _ occurs.

提交回复
热议问题