Convert vb to c#

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
Danny
User
Posts: 138

Convert vb to c#

Post by Danny »

Hi,

We have a problem converting vb to c#.

vb:
<field>.EditValue.RemoveRange(1, 2)

We get errors, how to convert this code to c# ?

Regards,


motfs
User
Posts: 258

Post by motfs »

It is the same for C# and VB. See this link: h+ttps://msdn.microsoft.com/en-us/library/y33yd2b5(v=vs.110).aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-2

What error you got? Make sure you cast object to List<T> first to use RemoveRange().


Danny
User
Posts: 138

Post by Danny »

Hi,

It seems this is the solution:

List<string> list2 = new List<string>();
list2.Add(<field>.EditValue.ToString());
list2.RemoveRange(1, 2);

Regards,


Post Reply