Search code examples
c#vb.netstrdup

Vb.Net convert StrDup to C#.net


I have this line of code:

strKey &= Strings.StrDup(intKeySize - intLength, chrKeyFill)

What is the equivalent of this code in C#? I can't seem to find it.


Solution

  • strKey += new String(chrKeyFill, intKeySize - intLength);
    

    or

    strKey = strKey.PadRight(intKeySize, chrKeyFill)