Jump to content

Print specific part of variable

Recommended Posts


Hello everyone, just can't find out simple syntax as I started programming with python. How can I print specific part of text/variable in AutoIT.

As in Python would be:

variable = "Some kind of text"
print variable[5:9]

Output: kind


Share this post

Link to post
Share on other sites

You would use StringMid to get the section of string you want. It takes a starting position and a count of how  many characters to extract.

#include <String.au3>

Global $variable = "Some kind of text"

ConsoleWrite(StringMid($variable, 6, 4) & @CRLF)


  • Like 1

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.