I have a list AllIDs.
List
I want to to substring operation on a member field AddressId based on a character "_".
I am using below LINQ query but getting compilation error:
AllIDs= AllIDs.Where(s => s.AddressId.Length >= s.AddressId.IndexOf("_")).Select(s => s.AddressId.Substring(s.AddressId.IndexOf("_"))).ToList();
Error:
Cannot implicitly convert type 'System.Collections.Generic.List
I have a list AllIDs.
List
I want to to substring operation on a member field AddressId based on a character "_".
I am using below LINQ query but getting compilation error:
AllIDs= AllIDs.Where(s => s.AddressId.Length >= s.AddressId.IndexOf("_")).Select(s => s.AddressId.Substring(s.AddressId.IndexOf("_"))).ToList();
Error:
Cannot implicitly convert type 'System.Collections.Generic.List
Santhosh Kumar JayaramanPosted Oct 12, 2012, 2:17 AM
public class class1
{
static void Main()
{
List
}
}
This will set my email field to
_pnl
_tpnl
_ttpnl