Jump to content

a string question


Recommended Posts

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?

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

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!

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...