Jump to content

Help with string


 Share

Recommended Posts

also every string number i need like (113579) as stated in the example above this post begins with myfolderid= and then the number I need. I tried the help file but I cant find anything that works. so in pseudo it should look like this

1. find myfolder= in string

2. get the numbers after the "=" sign.

thanks for the help.

Link to comment
Share on other sites

Hi,

#include<Array.au3>
#include<String.au3>
Global $string = "inmycomputer&myfolderid=113579"
Global $found = StringRegExp($string, "\d{1,}", 3)
_ArrayDisplay($found, "Deine Zahl")

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

$What_I_Want = 113579
$ThisString = "inmycomputer&myfolderid=113579"
$FindThis = '='
$LetsSee = StringTrimLeft ($ThisString , (StringInStr ($ThisString , $FindThis,0,-1)))
MsgBox(0,"Help with String", $LetsSee)

This searches the string from right to left looking for the '=' sign. It records the character position from left to right, then erases everything left of the '=', including the '=' too.

Edited by PerryRaptor
Link to comment
Share on other sites

How about...

$string = 'inmycomputer&myfolderid=113579'
$hold = ''
$array = StringSplit($string, '')

Local $match[10] = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']

For $i = 1 To $array[0]
    For $x = 0 To 9
        If $array[$i] = $match[$x] Then $hold &= $array[$i]
    Next
Next

MsgBox(0, 'Result', $hold)

Ok, I was bored. :)

@Rein: Don't do this. :D

Edited by xcal
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...