select something from a string

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

select something from a string

abm0000abm-2
hello

is there a way to select a part of a string?
like:

a = "plua"
p = mid(a,1,3)

and then p = "lua"

thanks

Igor





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply | Threaded
Open this post in threaded view
|

RE: select something from a string

Emil Tchekov-3
Hi,



> is there a way to select a part of a string?
> like:
>
> a = "plua"
> p = mid(a,1,3)
>

please check the lua documentation "string.sub" for
Plua2 or "strsub" for Plua 1.

Regards

Emil Tchekov



       

       
               
___________________________________________________________
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply | Threaded
Open this post in threaded view
|

Re: select something from a string

abm0000abm-2
Thanks, i read the .html tutorial, but i didn't find nothing like that.





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply | Threaded
Open this post in threaded view
|

RE: Re: select something from a string

Emil Tchekov-3

Hi again,

> Thanks, i read the .html tutorial, but i didn't find
> nothing like that.

I said: "please look in the LUA manual" - you will not
find this keywords in the PLUA manual...

Plua is port of the language LUA for PALM OS. It has
some keywords more than the standart LUA in order to
give a way to use specific functions of the device,
there is no need to put the "standard" LUA keywords in
the PLUA manual, there are to find on mamy other
places - the best one is WWW.LUA.ORG

go to

http://www.lua.org/manual/5.0/manual.html#5.3

there you can find:

string.sub (s, i [, j])
Returns the substring of s that starts at i and
continues until j; i and j may be negative. If j is
absent, then it is assumed to be equal to -1 (which is
the same as the string length). In particular, the
call string.sub(s,1,j) returns a prefix of s with
length j, and string.sub(s, -i) returns a suffix of s
with length i.

This is only in case if you use PLUA2 - it is LUA 5.0
based

on PLUA1 you have to use "strsub" (same parameters)
instead.


Very best regards

Emil Tchekov


       

       
               
___________________________________________________________
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/