如何在 AutoIt 中访问像数组一样的字符串? (我正在将代码从 C++ 移植到 AutoIt)
好吧,啊,语法转换问题在这里...我该如何在 AutoIt 中做到这一点?
String theStr = "Here is a string";
String theNewStr = "";
for ( int theCount = 0; theCount < theStr.Size(); theCount++ )
{
theNewStr.Append(theStr[theCount]);
}
我正在尝试访问 AutoIt 中字符串中的各个字符并提取它们。就是这样。谢谢。
Ok, gah, syntax conversion issue here...How would I do this in AutoIt?
String theStr = "Here is a string";
String theNewStr = "";
for ( int theCount = 0; theCount < theStr.Size(); theCount++ )
{
theNewStr.Append(theStr[theCount]);
}
I am trying to access individual chars within a string in AutoIt and extract them. Thats's it. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个怎么样:
What about this:
在 autoit 中,复制字符串就像复制字符串一样简单。要访问字符串的一部分(包括字符,它仍然是字符串),您可以使用 StringMid(),它是 Microsoft BASIC-80 和现在的 Visual BASIC(以及所有 BASIC)的保留。你仍然可以这样做
,或者你可以以困难的方式做到这一点:
&是 autoit 中的串联。 stringmid 提取字符串的一块。它也可能允许您执行相反的操作:用其他内容替换字符串的一部分。但我会用它来做单元测试。我认为这在 BASIC 中有效,但不确定 autoit 是否有效。
in autoit, it's just as simple to copy a string. to access a piece of a string (including a character, which is still a string) you use StringMid() which is a holdover from Microsoft BASIC-80 and now Visual BASIC (and all BASICs). you can stil do
or you can do it the hard way:
& is concatenation in autoit. stringmid extracts a chunk of a string. it MIGHT also allow you to do the reverse: replace a chunk of a string with something else. but I would do unit testing with that. I think that works in BASIC, but not sure about autoit.