c# - Vb.Net 将 StrDup 转换为 C#.net

标签 c# vb.net strdup

我有这行代码:

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

这段代码在 C# 中的等价物是什么?我好像找不到。

最佳答案

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

strKey = strKey.PadRight(intKeySize, chrKeyFill)

关于c# - Vb.Net 将 StrDup 转换为 C#.net,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5902246/

相关文章:

c# - 号码本地化不是不必要的吗?

VB.Net-评估字符串中的数学表达式

c - 如何在 C 中将 malloc + strcpy 转换为 strdup?

c++ - strdup 还是 _strdup?

asp.net - 处理程序页面 (.ashx) 可以获取配置设置吗?

c - 重复 strdup 的内存泄漏

c# - 字符串转十进制解析C#

c# - 如何将 struct 从 C# managed 传递到 C++ unmanaged DLL 并获得 struct 结果?

c# - 使用 Assembly.Load(path) 时找不到文件或程序集

c# - 检查字符串是否仅包含 C# 中的数字的最快方法