c# - Mid as target of an assignment -


i try old vb application in c# convert, while i've encountered line of code:

mid(strdata, intposition + 1, intlenght) = strvalue 

how can translated c#?

you have combine remove , insert, like:

strdata.remove(intposition, intlenght).insert(intposition, strvalue); 

the above assumes length of strvalue equal intlenght. if strvalue might longer, replicate mid statement, need do:

strdata.remove(intposition, intlenght)        .insert(intposition, strvalue.substring(0, intlenght)); 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -