Jump to content

Copying substring from a String


Recommended Posts

Hello Folks,

I want to copy a substring from a string. Since autoit strings are not like C strings. I am unable to copy a portion of string to new string.

I want to extract file size from a torrent file. And I want torrent file to be unchanged.

Here is how I tried

; Fille size
$fh = FileOpen("C:\Documents and Settings\User\My Documents\torrents\file.torrent", 0)
$contents = FileRead($fh)
; File size is mentioned after keyword 'length'
$startI = StringInStr($contents, "lengthi")
$endI = StringInStr($contents, ":", 1, 1, $startI)
; I want to copy string between startI and endI to a new string. How to do that?

Your help required.

Regards,

JinBaba

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...