c# - How to get the intermediate portion of string? -


i have string under

var input= "dbo.xyx.v1.userdefinedfunction"; 

the desired output "xyx.v1";

my attempt

var input = "dbo.xyx.v1.userdefinedfunction"; var intermediate = input.split('.').skip(1); var res = intermediate.reverse().skip(1).aggregate((a, b) => b + "." + a); 

works fine..but other proper , elegant method?

kindly note can part(in example showed 4 parts)

e.g. input : "dbo.part1.part2.part3.part4.userdefinedfunction" output : "part1.part2.part3.part4"

   string output= input.substring(input.indexof('.') + 1,                    input.lastindexof('.') - input.indexof('.') - 1); 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -