String Library - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: HP Prime Software Library (/forum-15.html) +--- Thread: String Library (/thread-5141.html) |
String Library - Tyann - 11-16-2015 12:11 PM Bonjour Je vous propose une petite bibliothéque de fonctions traitant des chaînes de caractères. Un fichier tetxe vous en détaille le contenu. Espérant que cela vous sera utile. Merci de vôtre attention. Hello I propose a small library of functions dealing with strings. A Tetxe you file details the content . Hoping that it will help. Thanks for your attention. RE: String Library - Tyann - 12-07-2015 09:43 PM 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) example: EXTRACT("250_km","_") -> "_km" EXTRACT("250_km de bouchons",{"_",3}) -> "_km" RE: String Library - Tyann - 12-23-2015 06:39 AM Bonjour Les fonctions LFORMAT ET RFORMAT ne fonctionnent pas correctement. Exemple : LFORMAT(16,2,"0") renvoie "0016" au lieu de "16". Ceci est du à un bug de la fonction MAKELIST. Voici une version corrigée de setstr qui est utilisée par ces deux fonctions: Hello The LFORMAT AND RFORMAT functions do not work properly. Example : LFORMAT (16,2,"0" ) returns " 0016 " instead of "16" . This is due to a bug in the MAKELIST function. Here is a corrected version of setstr that is used by these two functions: Code:
RE: String Library - BruceH - 03-20-2017 03:30 PM Another function: replace a placeholder in a string with another e.g. SREPL("Hello %w", "%w", "world") -> "Hello world" Code: EXPORT SREPL(str, key, val) RE: String Library - Tyann - 03-20-2017 08:39 PM Bonjour Sauf erreur, la fonction intégrée REPLACE permet cela. Merci de vôtre intêret. Hello Unless you make a mistake, the built-in REPLACE function allows this. Thanks for your interest. RE: String Library - BruceH - 03-20-2017 10:18 PM (03-20-2017 08:39 PM)Tyann Wrote: Bonjour From the User Guide: REPLACE("123456", 2, "GRM") -> "1GRM56" but SREPL("123456", "2", "GRM") -> "1GRM3456" RE: String Library - Tyann - 03-20-2017 10:44 PM Quote: but Code: REPLACE("123456", "2", "GRM") -> "1GRM3456" RE: String Library - BruceH - 03-21-2017 04:36 PM (03-20-2017 10:44 PM)Tyann Wrote:Quote: Ah, I see now what you are saying. You're right. |