Post Reply 
String Library
12-07-2015, 09:43 PM
Post: #2
RE: String Library
Bonjour
Je vous propose une nouvelle fonction à ajouter à la library:

Hello
I propose a new function to add to the library :

Code:
EXPORT EXTRACT(s,o)
//string,char or {char,num}
BEGIN
 LOCAL n:=-1,p,c;
 IF TYPE(o)==6 THEN
  c:=o(1);n:=o(2);
 ELSE
  c:=o;
 END;
 c:=typara(c);p:=INSTRING(s,c);
 n:=IFTE(n<0,DIM(s)-p+1,n);
 IF p==0 OR n==0 THEN
  "";
 ELSE
  MID(s,p,n);
 END;
END;
exemple:
example:
EXTRACT("250_km","_") -> "_km"
EXTRACT("250_km de bouchons",{"_",3}) -> "_km"

Sorry for my english
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
String Library - Tyann - 11-16-2015, 12:11 PM
RE: String Library - Tyann - 12-07-2015 09:43 PM
RE: String Library - Tyann - 12-23-2015, 06:39 AM
RE: String Library - BruceH - 03-20-2017, 03:30 PM
RE: String Library - Tyann - 03-20-2017, 08:39 PM
RE: String Library - BruceH - 03-20-2017, 10:18 PM
RE: String Library - Tyann - 03-20-2017, 10:44 PM
RE: String Library - BruceH - 03-21-2017, 04:36 PM



User(s) browsing this thread: 1 Guest(s)