Vb.Net将StrDup转换为C#.Net
我有一行代码:Vb.Net将StrDup转换为C#.Net,c#,vb.net,strdup,C#,Vb.net,Strdup,我有一行代码: strKey &= Strings.StrDup(intKeySize - intLength, chrKeyFill) 这段代码在C#中的等价物是什么?我好像找不到它 strKey += new String(chrKeyFill, intKeySize - intLength); 或 就我个人而言,我认为字符串构造函数方法比VB.Net字符串库更笨拙,可读性更低 using Microsoft.VisualBasic; ... Strings.StrDup(
strKey &= Strings.StrDup(intKeySize - intLength, chrKeyFill)
这段代码在C#中的等价物是什么?我好像找不到它
strKey += new String(chrKeyFill, intKeySize - intLength);
或
就我个人而言,我认为字符串构造函数方法比VB.Net字符串库更笨拙,可读性更低
using Microsoft.VisualBasic;
...
Strings.StrDup(2, '\t');
strKey += strKey.PadRight(strKey.Length + (intKeySize - intLength), chrKeyFill)
using Microsoft.VisualBasic;
...
Strings.StrDup(2, '\t');