Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi pos, casesensitive? (https://www.delphipraxis.net/74529-pos-casesensitive.html)

Andreas L. 4. Aug 2006 17:31


pos, casesensitive?
 
Hi,
ist die Funktion "pos" casesensitive? In der Delphihilfe steht darüber nichts. Also findet
Delphi-Quellcode:
pos('bla', string1)
sowohl bla als auch Bla oder BLA oder bLa, etc. ???

Neutral General 4. Aug 2006 17:34

Re: pos, casesensitive?
 
probiers doch einfach aus ;)


EDIT: Habs ausprobiert: Jo pos ist casesensitive ;) (=> pos('bla') findet 'Bla' nicht!)

Gruß
Neutral General

3_of_8 4. Aug 2006 17:41

Re: pos, casesensitive?
 
Falls du es case insensitive haben willst, nimm Delphi-Referenz durchsuchenAnsiLowerCase

Andreas L. 4. Aug 2006 17:41

Re: pos, casesensitive?
 
Zitat:

Zitat von Neutral General
probiers doch einfach aus ;)


EDIT: Habs ausprobiert: Jo pos ist casesensitive ;) (=> pos('bla') findet 'Bla' nicht!)

Gruß
Neutral General

Danke für deine Antwort. Gibts eine andere Funktion die das kann? Vllt. PosEx? Eine onBoard Routine von D7 wäre toll aber ich importiere gerne auch eine andere Unit in mein Projekt.

himitsu 4. Aug 2006 17:44

Re: pos, casesensitive?
 
Wozu? pos ist doch casesensitiv!

3_of_8 4. Aug 2006 17:44

Re: pos, casesensitive?
 
Gibt es: :lol:

Delphi-Quellcode:
function CIPos(const substr, s: String): Integer;
begin
Result:=Pos(AnsiLowerCase(substr), AnsiLowerCase(s));
end;
EDIT: @himitsu: Das will er ja gerade nicht.

Andreas L. 4. Aug 2006 17:46

Re: pos, casesensitive?
 
Zitat:

Zitat von 3_of_8
Gibt es: :lol:

Delphi-Quellcode:
function CIPos(const substr, s: String): Integer;
begin
Result:=Pos(AnsiLowerCase(substr), AnsiLowerCase(s));
end;
EDIT: @himitsu: Das will er ja gerade nicht.

Hupps, hatte wohl deinen Post mit AnsiLowerCase weiter oben übersehen (wo ist denn der rote Kasten???). Also alles geklärt. Danke und Ciao.

himitsu 4. Aug 2006 17:49

Re: pos, casesensitive?
 
Zitat:

Zitat von 3_of_8
EDIT: @himitsu: Das will er ja gerade nicht.

aso ... klang halt anders :?


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:50 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz