Jump to content

Get word position


xAx
 Share

Recommended Posts

Hello

How can get a word position in string?

for example I want to get autoit position from the string below:

$pos=?????("I like autoit scripts")

$pos must return 8.

I have other question:

How can I cut string from an other?

Regards

Abduljabbar

Edited by xAx
Link to comment
Share on other sites

Use this to get string position:

$string=StringInStr("I Like AutoIT","AutoIT")
msgbox(4096,"",$string)
[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Link to comment
Share on other sites

To get a specific word from a string, u can use either stringleft, stringright,stringmid functions.

These will return u a specific no. of letters, in a selected range.

eg to get AutoIT from "I Love AutoIT"

MsgBox(4096,"",StringMid( "I Love AutoIT",8,13))
[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Link to comment
Share on other sites

To get a specific word from a string, u can use either stringleft, stringright,stringmid functions.

These will return u a specific no. of letters, in a selected range.

eg to get AutoIT from "I Love AutoIT"

MsgBox(4096,"",StringMid( "I Love AutoIT",8,13))
This doesn't make much sense because the keyword is pre-existent. This would be like me asking "What is your name Manjish?".
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...