Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÔÚDelphiÖУ¬×Ö·û´®²éÕÒ º¯Êý

DelphiÌṩµÄ×Ö·û´®º¯ÊýÀïÓÐÒ»¸öPosº¯Êý£¬ËüµÄ¶¨ÒåÊÇ£º
function Pos(Substr: string; S: string): Integer;
ËüµÄ×÷ÓÃÊÇÔÚ×Ö·û´®SÖвéÕÒ×Ö·û´®Substr£¬·µ»ØÖµÊÇSubstrÔÚSÖеÚÒ»´Î³öÏÖµÄλÖã¬Èç¹ûûÓÐÕÒµ½£¬·µ»ØֵΪ0¡£
ʹÓÃposº¯ÊýÀ´²éÕÒ×Ö·ûµÚÒ»´Î³öÏÖµÄλÖÃ
var
str1:string;
i,j:integer;
begin
str1:='dsf4654f6<ds>ad' ;
j:=pos('<',str1);//ÔÚ×Ö·û´®str1ÖвéÕÒ"<"
if j<>0 then   //µÃµ½µÄjÊÇ×Ö·û´®ÖгöÏÖµÄλÖã¬ÊÇÕûÐÍ
showmessage('<'+'ÔÚµÚ'+inttostr(j)+'¸öλÖÃ');  //µÚÊ®¸öλÖÃ
end;
===============================================
Êײ¿ function StrPos(const Str1, Str2: PChar): PChar; $[SysUtils.pas
¹¦ÄÜ ·µ»ØÖ¸Õë×Ö·û´®Str2ÔÚStr1ÖеÚÒ»¸ö³öÏֵĵØÖ·
˵Ã÷ ûÓÐÕÒµ½Ôò·µ»Ø¿ÕÖ¸Õë;StrPos('12345', '3') = '345'
²Î¿¼ <NULL>
Àý×Ó Edit3.Text := StrPos(PChar(Edit1.Text), PChar(Edit2.Text));
===================================================
StrScan : ·µ»ØÒ»¸ö×Ö·ûÔÚÒ»¸ö PChar ´®ÖеÚÒ»´Î³öÏÖµÄλÖÃÖ¸Õë;
StrRScan : ·µ»ØÒ»¸ö×Ö·ûÔÚÒ»¸ö PChar ´®ÖÐ×îºóÒ»´Î³öÏÖµÄλÖÃÖ¸Õë;
StrPos : ·µ»ØÒ»¸ö PChar ´®ÔÚÁíÒ»¸ö PChar ´®ÖеÚÒ»´Î³öÏÖµÄλÖÃÖ¸Õë.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
//StrScan¡¢StrRScan:
procedure TForm1.Button1Click(Sender: TObject);
var
p: PChar;
str: string;
begin
str := 'ABCBBBCBA';
p := StrScan(PChar(str), 'B');
ShowMessage(p); {BCBBBCBA}
p := StrRScan(PChar(str), 'B');
ShowMessage(p); {BA}
end;
//StrPos:
procedure TForm1.Button2Click(Sender: TObject);
var
p: PChar;
str: string;
begin
str := '123456789';
p := StrPos(PChar(str), '456');
ShowMessage(p); {456789}
end;
end.


Ïà¹ØÎĵµ£º

Delphi Ìõ¼þÅжÏÄÇЩÊÂ

¼¼Êõ½»Á÷,DH½²½â. ֮ǰÕÕ×ÅÌìÊéÒ¹¶Á,ÓÃDelphiÀ´ÅªÁËÏÂÑ­»·Ìå,ÏÖÔÚ¾ÍÀ´ÅªÒ»ÏÂÌõ¼þÅжϰÉ.
Ê×Ïȿ϶¨ÊÇÎÒÃǾ­³£¿´¼ûµÄIFÓï¾ä¿©. Var
I: Integer;
Begin
I:= 99;
If (I> 0)And (I< 0) Then
Writeln('I>0')
Else
If (I> 10)And (I< 100) Then
Writeln('I>10 and I100');
End.
·´»ã±à³öÀ´»áÊÇ ......

Delphi²¿·Öº¯Êý¡¢ÃüÁî¡¢ÊôÐÔÖÐÎÄ˵Ã÷

×¢²áÂ룺6amd-pdj686-apme9d-9cdr
Ãܳףºyvx-27c
Delphi²¿·Öº¯Êý¡¢ÃüÁî¡¢ÊôÐÔÖÐÎÄ˵Ã÷
Abort º¯Êý ÒýÆð·ÅÆúµÄÒâÍâ´¦Àí
Abs º¯Êý ¾ø¶ÔÖµº¯Êý
AddExitProc º¯Êý ½«Ò»¹ý³ÌÌí¼Óµ½ÔËÐÐʱ¿âµÄ½áÊø¹ý³Ì±íÖÐ
Addr º¯Êý ·µ»ØÖ¸¶¨¶ÔÏóµÄµØÖ·
AdjustLineBreaks º¯Êý ½«¸ø¶¨×Ö·û´®µÄÐзָô·ûµ÷ÕûΪCR/LFÐòÁÐ
Align ÊôÐÔ Ê¹¿Ø¼þÎ ......

SDL & Object Pascal (Delphi) [3] ÖÆ×÷Ò»¸öÑ¡µ¥


Ò»¸öÑ¡µ¥´óÖÂÊÇÕâÑù£º
1.¿ÉÒÔ±»ÒÔijÖÖÐÎʽºô½Ð³öÀ´£¬Èç°´ÏÂesc£»
2.ÔÚÕâ¸öÑ¡µ¥Öй¦ÄܼüÓв»Í¬µÄ¶¨Ò壬ÈçÔ­±¾·½Ïò¼ü¿ØÖÆ×ß·£¬µ«ÏÖÔÚ¸ÄΪ¿ØÖƹâ±êµÄλÖã»
3.°´ÏÂÈ·¶¨¼üºóÓжÔÓ¦¹¦Äܱ»Ö´ÐУ»
4.¿ÉÒÔ±»¹Ø±Õ¡£
ÄÇôÎҵİ취ÊDZàдÁ½¸ö×ӳ̣¬ÆäÖÐÒ»¸ö´¦ÀíÑ¡µ¥ÖеÄʼþ£¬ÁíÍâÒ»¸öרߺÔð»­Ñ¡µ¥¡£
ÔÚ´Ó²½ÐÐÇл»µ½Ñ¡µ¥ ......

¹ØÓÚdelphi Moveº¯ÊýµÄÓ÷¨Ïê½â

ʹÓÃdelphi¶àÄê,ǰЩÌìºöÈ»Óöµ½²»»ástringתpbyte,ºÜÊÇʧÂä,´Ëʱ¶ÔÓÚ±à³Ì»ù±¾¹¦µÄÖØÒªÐÔÉîÓÐÌå»á.ÕâÆäÖÐÓõ½MOVEº¯Êý.
ʹÓÃdelphi¶àÄê,ǰЩÌìºöÈ»Óöµ½²»»ástringתpbyte,ºÜÊÇʧÂä,´Ëʱ¶ÔÓÚ±à³Ì»ù±¾¹¦µÄÖØÒªÐÔÉîÓÐÌå»á.ÕâÆäÖÐÓõ½MOVEº¯Êý.
 ¸ãÁ˺ÃÒ»»á²Å¸ãÃ÷°×ÆäÓ÷¨.ËùÒÔÏëÌù³öÀ´°ïÖúÐèÒª°ïÖúµÄÈË.
var
 &nb ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ