Given the below string
Declare @string varchar(max)=\'abc ___________ deffns ___ cg _ hif _______hh ihs\';
this is the Output requi
In C# you can use:
string str = Regex.Replace(s, @"(_)\1{5,}", Lastname);
It will match character _ if more than 5 _ occurs.