Après windows pour les nuls, voici PB pour les bons (ou presque).

Le forum (ô combien francophone) des utilisateurs de Powerbuilder.

Recherche rapide

Annonce

Certaines rubriques, dont des cours, sont uniquement visibles par les membres du forum ^^.
Dans la rubrique Liens & Références, vous avez accès à un sommaire de téléchargement, profitez-en !
Il existe maintenant un nouveau TOPIC "Votre CV en Ligne" accessible uniquement par demande.

#1 25-10-2007 08:56:01

bdf94  
Membre Power Geek
Date d'inscription: 04-10-2006
Messages: 180
Pépites: 2,231
Banque: 0

[RESOLU] Recherche la position d'un caractère

Bonjour,

J'ai une chaine de caractère. Je voudrais trouver la ou les position(s) d'un carcatère précis.
Quelle est la fonction ?

Exemple :
chaine de caractere = "coucou, c'est moi"
je voudrais trouver la position de la virgule = 6

Dernière modification par bdf94 (25-10-2007 09:22:55)

Hors ligne

 

#2 25-10-2007 09:00:04

pick ouic  
La bourse ou la vie ^^
Award: gearotter
Lieu: Massy-Verrières
Date d'inscription: 29-05-2006
Messages: 4658
Pépites: 942
Banque: 2,147,483,647
Site web

Re: [RESOLU] Recherche la position d'un caractère

la fonction  POS


Connaitre son ignorance est une grande part de la connaissance.
http://animegifs.free.fr/anime/mazinger/mazinger.gif

Hors ligne

 

#3 25-10-2007 09:23:21

JCZ  
Builder Power
Award: bf
Lieu: 75019 paris
Date d'inscription: 21-05-2007
Messages: 1724
Pépites: 496,453,703,213
Banque: 9,223,372,036,854,776,000

Re: [RESOLU] Recherche la position d'un caractère

pick ouic a écrit:

la fonction  POS

Pos ou PosA


Description

Temporarily converts a string from Unicode to DBCS based on the current locale, then finds one string within another string.

Syntax

PosA (string1, string2, {start})

Argument    Description
string1    The string in which you want to find string2.
string2    The string you want to find in string1.
start
(optional)    A long indicating the position in string1 where the search will begin. The position is indicated by the number of bytes you specify for this argument. The default is 1.
Return value

Long. Returns a long whose value is the starting position of the first occurrence of string2 in string1 after the position in bytes specified by start. If string2 is not found in string1 or if start is not within string1, PosA returns 0. If any argument's value is null, PosA returns null.

Usage

PosA replaces the functionality that Pos had in DBCS environments in PowerBuilder 9. In SBCS environments, Pos, PosW, and PosA return the same results.


Face à l'agression, la puissance de l'intelligence

Hors ligne

 

Pied de page des forums

Propulsé par FluxBB 1.2.22