Sign in to follow this  
Followers 0
Nemcija

String Search ?

3 posts in this topic

Hello B)

Is there any method to search for a string in a string ?

I have got this String: "bla blub blabla aknownpart:wantedstring blablablu bla"

I don't know the exactly string alway's but i know "aknownpart", and i'm searching for some letters behind this part ("wantedstring" < unknown length but it alway's ends with the same letter). Have you any idea how i can do this ?

Thank you.

And i hope you understand my bad english ^^


[url=www.vergessene-welt.de][/url]

Share this post


Link to post
Share on other sites



Hello B)

Is there any method to search for a string in a string ?

I have got this String: "bla blub blabla aknownpart:wantedstring blablablu bla"

I don't know the exactly string alway's but i know "aknownpart", and i'm searching for some letters behind this part ("wantedstring" < unknown length but it alway's ends with the same letter). Have you any idea how i can do this ?

Thank you.

And i hope you understand my bad english ^^

$MyString = "bla blub blabla aknownpart:wantedstring blablablu bla"

$MySearch = "aknownpart"

$MyResult = StringLeft( $MyString , Stringinstr( $MyString , $Mysearch , 0 )-1 )

MsgBox(1, " And the result is : ", $MyResult )

HTH

Francis

Share this post


Link to post
Share on other sites

Thank you a lot.

I think in this way it works ..

func searchleft($str,$src)

return StringLeft($str , Stringinstr( $str , $src , 0 )-1 )

EndFunc

func searchright($str,$src)

if Stringinstr( $str , $src , 0 ) <> 0 then

return StringRight($str, StringLen($str)-StringLen($src)-Stringinstr( $str , $src , 0 )+1)

Else

return ""

EndIf

EndFunc

*working on* B)


[url=www.vergessene-welt.de][/url]

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