Sign in to follow this  
Followers 0
Sim0n

a string question

4 posts in this topic

Hi, I want to know how to get the following done:

I have a string, like this:

blablablablabla
blabla hey blaablaablabla bla bla

What I want to get done, is to get to the clipboard the word hey and then for example 5 characters,

so in this example I want to get the string hey blaab to clipboard.

Any ideas?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Look at StringMid + StringInStr + StringLen or StringRegExp.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hi.

clipput() and stringregexp() already were answered for you.

For a quick look how results look like try this one:

#include <array.au3>

$MyString="blablablablabla" & @LF & "blabla hey blaablaablabla hey again bla bla"
$MySubStr=StringRegExp($MyString,"(hey .{5})",3)
_ArrayDisplay($MySubStr)

When starting with regexp don't miss this one:

- Help file

- Tutorials

- String Regular expression (run the StringRegExpGUI.au3 at the bottom of that topic)

Regards, Rudi.

Edited by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

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
Sign in to follow this  
Followers 0