ใช้ strutils;
ฟังก์ชั่นแรก Ansiresemblestext (const atext, aother: string): boolean;
$ [strutils.pas
ฟังก์ชั่นส่งคืนไม่ว่าทั้งสองสตริงจะคล้ายกัน
คำอธิบาย ANSI (สถาบันมาตรฐานแห่งชาติอเมริกัน) สถาบันมาตรฐานแห่งชาติอเมริกัน
ฟังก์ชั่นอ้างอิง strutils.soundexproc;
ตัวอย่าง checkBox1.Checked: = ansiresemblestext (edit1.text, edit2.text);
ฟังก์ชั่นแรก ansicontainstext (const atext, asubtext: string): บูลีน;
$ [strutils.pas
ฟังก์ชั่นส่งคืนว่าสตริง atext มี asubtext สตริงย่อย
บ่งบอกถึงกรณีที่ไม่รู้สึกตัว
ฟังก์ชั่นอ้างอิง strutils.ansiuppercase;
ตัวอย่าง checkBox1.Checked: = ansicontainstext (edit1.text, edit2.text);
ฟังก์ชั่นแรก AnsistartStext (const asubtext, atext: string): บูลีน;
$ [strutils.pas
ฟังก์ชั่นส่งคืนไม่ว่าสตริง atext เริ่มต้นด้วย asubtext substring
บ่งบอกถึงกรณีที่ไม่รู้สึกตัว
ฟังก์ชั่นอ้างอิง windows.Comparestring
ตัวอย่าง checkbox1.Checked: = ansiSistartStext (edit1.text, edit2.text);
ฟังก์ชั่นแรก ansiendstext (const asubtext, atext: string): บูลีน;
$ [strutils.pas
ฟังก์ชั่นส่งคืนไม่ว่าสตริง atext จะลงท้ายด้วย asubtext substring
บ่งบอกถึงกรณีที่ไม่รู้สึกตัว
ฟังก์ชั่นอ้างอิง windows.Comparestring
ตัวอย่าง checkbox1.Checked: = ansiendstext (edit1.text, edit2.text);
ฟังก์ชั่นแรก ansirePlaceText (const atext, afromtext, atotext: string):
สตริง; $ [strutils.pas
ฟังก์ชั่นส่งคืนผลลัพธ์ของการเปลี่ยน Afromtex
บ่งบอกถึงกรณีที่ไม่รู้สึกตัว
ฟังก์ชั่นอ้างอิง sysutils.stringreplace;
ตัวอย่าง edit4.text: = ansirePlaceText (edit1.text, edit2.text, edit3.Text);
ฟังก์ชั่นแรก ansimatchText (const atext: string; const avalues: อาร์เรย์ของ
สตริง): บูลีน;
ฟังก์ชั่นส่งคืนไม่ว่าสตริง atext จะรวมอยู่ใน Avalues array array array
บ่งบอกถึงกรณีที่ไม่รู้สึกตัว
ฟังก์ชั่นอ้างอิง strutils.ansiindextext
ตัวอย่าง checkbox1.Checked: = ansimatchText (edit1.text, ['A1', 'A2', 'A3',
'a4']);
ฟังก์ชั่นแรก ansiindextext (const atext: string; const avalues: array ของ
สตริง): จำนวนเต็ม;
ฟังก์ชั่นส่งคืนตำแหน่งของสตริง atext ใน Avalues array array array
บ่งชี้ว่าเป็นกรณีที่ไม่ได้รับการตอบรับ
ฟังก์ชั่นอ้างอิง sysutils.ansisametext
ตัวอย่าง spinedit1.value: = ansiindextext (edit1.text, ['a1', 'a2', 'a3', 'a4']);
ฟังก์ชั่นแรก ansicontainsstr (const atext, asubtext: string): บูลีน;
$ [strutils.pas
ฟังก์ชั่นส่งคืนว่าสตริง atext มี asubtext สตริงย่อย
คำอธิบายกรณีอ่อนไหว
ฟังก์ชั่นอ้างอิง strutils.ansipos
ตัวอย่าง checkbox1.Checked: = ansicontainsstr (edit1.text, edit2.text);
ฟังก์ชั่นแรก ansiSistartsstr (const asubtext, atext: string): บูลีน;
$ [strutils.pas
ฟังก์ชั่นส่งคืนไม่ว่าสตริง atext เริ่มต้นด้วย asubtext substring
คำอธิบายกรณีอ่อนไหว
ฟังก์ชั่นอ้างอิง sysutils.ansisamestr
ตัวอย่างช่องทำเครื่องหมายที่ 1 ตรวจสอบ: = ansistartsstr (edit1.text, edit2.text);
ฟังก์ชั่นแรก ansiendsstr (const asubtext, atext: string): บูลีน;
$ [strutils.pas
ฟังก์ชั่นส่งคืนไม่ว่าสตริง atext จะลงท้ายด้วย asubtext substring
คำอธิบายกรณีอ่อนไหว
ฟังก์ชั่นอ้างอิง sysutils.ansisamestr
ตัวอย่าง checkbox1.Checked: = ansiendsstr (edit1.text, edit2.text);
ฟังก์ชั่นแรก ansireplacestr (const atext, afromtext, atotext: string):
สตริง; $ [strutils.pas
ฟังก์ชั่นส่งคืนผลลัพธ์ของการเปลี่ยน Afromtex
คำอธิบายกรณีอ่อนไหว
ฟังก์ชั่นอ้างอิง sysutils.stringreplace;
ตัวอย่าง edit4.text: = ansireplacestr (edit1.text, edit2.text, edit3.Text);
ฟังก์ชันแรก Ansimatchstr (const atext: string; const avalues: อาร์เรย์ของ
สตริง): บูลีน;
ฟังก์ชั่นส่งคืนไม่ว่าสตริง atext จะรวมอยู่ใน Avalues array array array
คำอธิบายกรณีอ่อนไหว
ฟังก์ชั่นอ้างอิง strutils.ansiindexstr
ตัวอย่าง checkbox1.Checked: = ansimatchstr (edit1.text, ['A1', 'A2', 'A3',
'a4']);
ฟังก์ชั่นแรก ansiindexstr (const atext: string; const avalues: array ของ
สตริง): จำนวนเต็ม;
ฟังก์ชั่นส่งคืนตำแหน่งของสตริง atext ใน Avalues array array array
คำอธิบายกรณีอ่อนไหว
ฟังก์ชั่นอ้างอิง sysutils.ansisamestr
ตัวอย่าง spinedit1.value: = ansiindexstr (edit1.text, ['a1', 'a2', 'a3', 'a4']);
ฟังก์ชั่นแรก dupestring (const atext: string; acount: จำนวนเต็ม): สตริง;
$ [strutils.pas
ฟังก์ชั่นส่งคืนแบบจำลอง acount ของสตริง atext
คำอธิบายส่งคืน '' เมื่อ Acount เป็น 0
อ้างถึง function system.setLength
ตัวอย่าง edit3.Text: = dupestring (edit1.text, spinedit1.value);
ฟังก์ชั่นส่วนหัวย้อนกลับ (const atext: string): สตริง;
ฟังก์ชั่นส่งคืนลำดับผกผันของสตริง atext
คำอธิบายย้อนกลับ ('1234') = '4321'
อ้างถึง function system.setLength
ตัวอย่าง edit3.Text: = reversestring (edit1.Text);
ฟังก์ชั่นแรก stuffstring (const atext: string; astart, alength: cardinal;
const asubtext: string): สตริง;
ฟังก์ชั่นส่งคืนสตริงซ้อนกัน
คำอธิบาย ASTART: ตำแหน่งการทำรัง;
อ้างถึง function system.copy
ตัวอย่าง edit3.Text: = stuffstring (edit1.text, spinedit1.value, spinedit2.value,
แก้ไข 2.Text);
ฟังก์ชั่นแรกแบบสุ่มจาก (const avalues: อาร์เรย์ของสตริง): สตริง;
$ [strutils.pas
ฟังก์ชั่นแบบสุ่มส่งคืนองค์ประกอบใน array array array
อธิบายว่าขอแนะนำให้ดำเนินการสุ่มก่อน
ฟังก์ชั่นอ้างอิงระบบ
ตัวอย่างสุ่ม;
ฟังก์ชั่นส่วนหัว ifthen (Avalue: Boolean; const atrue: string; afalse: string =
''): สตริง;
ฟังก์ชั่นส่งคืนสตริงตรรกะที่ระบุ
ifthen (จริง, 'ใช่', 'ไม่') = 'ใช่'; ifthen (เท็จ 'ใช่', 'ไม่') = 'ไม่'
อ้างอิง <Null>
ตัวอย่าง edit3.Text: = ifthen (checkBox1.Checked, edit1.text, edit2.text);
ฟังก์ชั่นส่วนหัว leftstr (const atext: string; const acount: integer): string;
$ [strutils.pas
ฟังก์ชั่นส่งคืนอักขระ Acount ที่ด้านซ้ายของสตริง atext
คำอธิบาย leftstr ('123456', 3) = '123'
อ้างถึง function system.copy
ตัวอย่าง edit3.Text: = leftstr (edit1.text, spinedit1.value);
ฟังก์ชั่นแรก Rightstr (const atext: string; const acount: จำนวนเต็ม): string;
$ [strutils.pas
ฟังก์ชั่นส่งคืนอักขระ acount ทางด้านขวาของสตริง atext
คำอธิบาย Rightstr ('123456', 3) = '456'
อ้างถึง function system.copy
ตัวอย่าง edit3.Text: = rightStr (edit1.text, spinedit1.value);
ฟังก์ชั่นแรก midstr (const atext: string; const astart, acount: จำนวนเต็ม):
สตริง; $ [strutils.pas
ฟังก์ชั่นส่งคืนอักขระ atext acount สตริงเริ่มต้นจาก Astart
หมายถึงสำเนา
อ้างถึง function system.copy
ตัวอย่าง edit3.Text: = midstr (edit1.text, spinedit1.value, spinedit2.value);
ฟังก์ชั่นแรก SearchBuf (buf: pchar; buflen: จำนวนเต็ม; selstart, sellength:
จำนวนเต็ม;
pchar;
ฟังก์ชั่นส่งคืนตำแหน่งตัวชี้ค้นหาครั้งแรก
อธิบายฟังก์ชั่นนี้มักจะใช้ในการค้นหาสตริงในข้อความ
อ้างอิง <Null>
ตัวอย่าง
/////////// เริ่ม SearchBuf
ฟังก์ชั่น searchedit (editControl: tcustomedit; const searchstring: สตริง;
SearchOptions: TStringSearchOptions;
วาจา
บัฟเฟอร์, P: pchar;
ขนาด: Word;
เริ่ม
ผลลัพธ์: = เท็จ;
ถ้า (ความยาว (searchString) = 0) จากนั้นออก;
ขนาด: = editControl.getTextlen;
ถ้า (ขนาด = 0) ออกจาก;
บัฟเฟอร์: = stralloc (ขนาด + 1);
พยายาม
editControl.getTextBuf (บัฟเฟอร์, ขนาด + 1);
P: = SearchBuf (บัฟเฟอร์, ขนาด, editControl.SelStart, editControl.sellength,
SearchString, SearchOptions);
ถ้า p <> ไม่มีเริ่มต้น
editControl.SelStart: = p - บัฟเฟอร์;
editControl.Sellength: = ความยาว (SearchString);
ผลลัพธ์: = จริง;
จบ;
ในที่สุด
strdispose (บัฟเฟอร์);
จบ;
จบ;
ขั้นตอน tform1.button1click (ผู้ส่ง: tobject);
วาจา
SearchOptions: TStringSearchOptions;
เริ่ม
searchoptions: = [];
ถ้าช่องทำเครื่องหมายที่ตรวจสอบแล้ว
รวม (searchoptions, sodown);
หากช่องทำเครื่องหมาย
รวม (searchoptions, somatchcase);
ถ้าช่องทำเครื่องหมายที่ตรวจสอบแล้ว
รวม (searchoptions, sowhoLeword);
Searchedit (memo1, edit1.text, searchoptions);
memo1.setFocus;
จบ;
/////////// สิ้นสุดการค้นหา
ฟังก์ชั่นแรก Soundex (const atext: string; alength: tsoundexlength = 4):
สตริง; $ [strutils.pas
ฟังก์ชั่นส่งคืนสตริงการตรวจจับ
คำอธิบาย: ตามวิธีการตรวจจับ (Soundex) คุณสามารถค้นหาสตริงของการตัดกัน;
อ้างอิง <Null>
ตัวอย่าง edit2.text: = soundex (edit1.text, spinedit1.value);
ฟังก์ชั่นส่วนหัว soundexint (const atext: string; alength: tsoundexintLength =
4): จำนวนเต็ม;
ฟังก์ชั่นส่งคืนจำนวนเต็มตรวจจับ
หมายความว่ายิ่งค่าของความยาวมากเท่าไหร่ความแม่นยำในการถอดรหัสก็จะยิ่งสูงขึ้น
อ้างอิง <Null>
ตัวอย่าง spinedit2.value: = soundexint (edit1.text, spinedit1.value);
ฟังก์ชั่นส่วนหัว decodesoundexint (Avalue: Integer): String;
ฟังก์ชั่นส่งคืนการถอดรหัสของจำนวนเต็มโพรบ
คำอธิบาย DecodesoundExint (SoundExint ('Hello')) เทียบเท่ากับ SoundEx ('Hello')
อ้างอิง <Null>
ตัวอย่าง edit2.text: = decodesoundexint (spinedit2.value);
ฟังก์ชั่นแรก SoundExword (const atext: string): word;
ฟังก์ชั่นส่งคืนค่าข้อความตรวจจับ
บ่งชี้ว่าไม่มีความยาวพารามิเตอร์ที่ได้รับการแก้ไขถึง 4
อ้างอิง <Null>
ตัวอย่าง spinedit2.value: = soundexword (edit1.text);
ฟังก์ชั่นแรก decodesoundexword (Avalue: Word): String;
ฟังก์ชั่นส่งคืนการถอดรหัสของค่าข้อความตรวจจับ
คำอธิบาย decodesoundexword (soundexword ('hello')) เทียบเท่ากับ soundex ('hello')
อ้างอิง <Null>
ตัวอย่าง edit2.text: = decodesoundexword (spinedit2.value);
ฟังก์ชั่นแรก SoundexSimilar (const atext, aother: string; alength:
tsoundexlength = 4): บูลีน;
ฟังก์ชั่นส่งคืนไม่ว่าจะเป็นสตริงโพรบของสองสายเท่ากัน
คำอธิบายผลลัพธ์: = soundex (atext, alength) = soundex (aother, alength)
อ้างอิง <Null>
ตัวอย่าง checkbox1.Checked: = soundexsimilar (edit1.text, edit2.text,
spinedit1.value);
ฟังก์ชั่นแรก SoundExCompare (const atext, aother: string; alength:
tsoundexlength = 4): จำนวนเต็ม; $ [strutils.pas
ฟังก์ชั่นส่งคืนผลลัพธ์ของการเปรียบเทียบสองสตริงเพื่อตรวจจับสตริง
คำอธิบายผลลัพธ์: = ansicomparest
ความยาว))
ฟังก์ชั่นอ้างอิง sysutils.ansicomparest
ตัวอย่าง spinedit2.value: = SoundExCompare (edit1.text, edit2.text,
spinedit1.value);
ฟังก์ชั่นแรก SoundExProc (const atext, aother: string): บูลีน;
$ [strutils.pas
ฟังก์ชั่นเรียกใช้ soundexsimilar เพื่อส่งคืนสตริงโพรบของสองสตริง
คำอธิบายของค่าเริ่มต้นของตัวแปรระบบ ansiresemblesproc
ฟังก์ชั่นอ้างอิง strutils.ansiresemblestext
ตัวอย่าง [var ansiresemblesproc: tcomparetextproc = soundexproc;]
ฟังก์ชั่นส่วนหัว Newstr (const s: string): pstring;
ฟังก์ชั่นส่งคืนที่อยู่ตัวชี้สตริงใหม่
คำอธิบายส่งคืน nullstr เมื่อสตริง s ว่างเปล่า
อ้างถึง Procedure System.New
ตัวอย่าง
////////////// เริ่มต้น Newstr, disposestr
ขั้นตอน tform1.button1click (ผู้ส่ง: tobject);
วาจา
P: Pstring;
เริ่ม
P: = Newstr (edit1.text);
edit2.text: = p^;
disposestr (p);
จบ;
///////////////////////////li
ขั้นตอนแรก disposestr (p: pstring);
ฟังก์ชั่นการปล่อยสตริงตัวชี้ p ทรัพยากร p
คำอธิบายใช้กับ NewsTR
อ้างถึง Procedure System.dispose
ตัวอย่าง <ดูด้านบนดูด้านล่าง>
ขั้นตอนแรกที่กำหนด (var p: pstring; const s: string);
$ [sysutils.pas
ฟังก์ชั่นอัปเดตสตริง s เป็นสตริงตัวชี้ p
คำอธิบายทรัพยากรที่ก่อนหน้านี้มีการเปิดตัวพอยน์เตอร์เมื่ออัปเดตค่า
ฟังก์ชั่นอ้างอิง sysutils.newstr; ฟังก์ชั่น sysutils.disposestr
ตัวอย่าง
////////////// เริ่มต้นที่กำหนด
ขั้นตอน tform1.button1click (ผู้ส่ง: tobject);
วาจา
P: Pstring;
เริ่ม
P: = Nil;
asystr (p, edit1.text);
edit2.text: = p^;
disposestr (p);
จบ;
////////////// END ATIMYSTR
ขั้นตอนแรกภาคผนวก (var dest: string; const s: string);
$ [sysutils.pas
ฟังก์ชั่นผนวกสตริง S หลังจากสตริง dest
คำอธิบายเทียบเท่ากับ Dest: = dest + s;
อ้างอิง <Null>
ตัวอย่าง
///////////////itced appendstr
ขั้นตอน tform1.button1click (ผู้ส่ง: tobject);
วาจา
S: String;
เริ่ม
s: = edit2.text;
Appendstr (s, edit1.text);
edit2.text: = s;
จบ;
///////////// end appendstr
ฟังก์ชั่นส่วนหัวตัวพิมพ์ใหญ่ (const s: string): สตริง;
ฟังก์ชั่นส่งคืนรูปแบบทุนของสตริง s
บ่งชี้ว่าไม่ได้ประมวลผลอักขระที่ไม่ใช่ lowercase
อ้างถึง Procedure System.setLength
ตัวอย่าง edit2.text: = uppercase (edit1.text);
ฟังก์ชั่นแรกตัวพิมพ์เล็ก (const s: string): สตริง; $ [sysutils.pas
ฟังก์ชั่นส่งคืนรูปแบบตัวพิมพ์เล็กของสตริง s
บ่งชี้ว่าไม่มีการประมวลผลอักขระที่ไม่ใช่ capsular
อ้างถึง Procedure System.setLength
ตัวอย่าง edit2.text: = ตัวพิมพ์เล็ก (edit1.text);
ฟังก์ชั่นส่วนหัวเปรียบเทียบ (const S1, S2: String): จำนวนเต็ม; $ [sysutils.pas
ฟังก์ชั่นกลับมาเปรียบเทียบอักขระสองตัว
คำอธิบายเมื่อ S1> S2 ส่งคืนค่า> 0;
อ้างอิง <Null>
ตัวอย่าง spinedit1.value: = เปรียบเทียบ (edit1.text, edit2.text);
ฟังก์ชั่นแรกเปรียบเทียบ (P1, P2: ตัวชี้ความยาว: จำนวนเต็ม): บูลีน;
แอสเซมเบลอร์;
ฟังก์ชั่นส่งคืนการเปรียบเทียบของตัวชี้หน่วยความจำสองตัว
คำอธิบายเปรียบเทียบ (pchar ('12a'), pchar ('12c'), 2) = true; comparemem (pchar ('12a'),
pchar ('12c'), 3) = เท็จ
อ้างอิง <Null>
ตัวอย่างช่องทำเครื่องหมายที่ 1 ตรวจสอบ: = comparemem (self, form1, 8);
ฟังก์ชั่นส่วนหัวเปรียบเทียบ (const S1, S2: สตริง): จำนวนเต็ม; $ [sysutils.pas
ฟังก์ชั่นกลับมาเปรียบเทียบสองสตริง
บ่งบอกถึงกรณีที่ไม่รู้สึกตัว
อ้างอิง <Null>
ตัวอย่าง spinedit1.value: = compareText (edit1.text, edit2.text);
ฟังก์ชั่นส่วนหัว sametext (const s1, s2: สตริง): บูลีน;
ฟังก์ชั่นส่งคืนไม่ว่าสองสายเท่ากัน
บ่งบอกถึงกรณีที่ไม่รู้สึกตัว
อ้างอิง <Null>
ตัวอย่าง checkBox1.Checked: = sameText (edit1.Text, edit2.text);
ฟังก์ชั่นแรก ansiuppercase (const s: string): สตริง;
ฟังก์ชั่นส่งคืนรูปแบบทุนของสตริง s
คำอธิบาย ANSI (สถาบันมาตรฐานแห่งชาติอเมริกัน) สถาบันมาตรฐานแห่งชาติอเมริกัน;
ฟังก์ชั่นอ้างอิง windows.charupperbuff
ตัวอย่าง edit2.text: = ansiuppercase (edit1.text);
ฟังก์ชั่นแรก ansilowercase (const s: string): สตริง;
ฟังก์ชั่นส่งคืนรูปแบบตัวพิมพ์เล็กของสตริง s
บ่งชี้ว่าไม่มีการประมวลผลอักขระที่ไม่ใช่ capsular
ฟังก์ชั่นอ้างอิง windows.charlowerbuff
ตัวอย่าง edit2.text: = ansilowercase (edit1.text);
ฟังก์ชั่นส่วนหัว ansicomparestr (const s1, s2: string): จำนวนเต็ม;
ฟังก์ชั่นย้อนกลับการเปรียบเทียบสองสตริง
คำอธิบายเมื่อ S1> S2 ส่งคืนค่า> 0;
ฟังก์ชั่นอ้างอิง windows.Comparestring
ตัวอย่าง spinedit1.value: = ansicomparestr (edit1.text, edit2.text);
ฟังก์ชั่นส่วนหัว ansisamestr (const s1, s2: string): บูลีน;
ฟังก์ชั่นส่งคืนไม่ว่าสองสายเท่ากัน
คำอธิบายกรณีอ่อนไหว
ฟังก์ชั่นอ้างอิง sysutils.ansicomparest
ตัวอย่าง checkbox1.Checked: = ansisamestr (edit1.text, edit2.text);
ฟังก์ชั่นส่วนหัว ansicomparetext (const S1, S2: String): จำนวนเต็ม;
ฟังก์ชั่นย้อนกลับการเปรียบเทียบสองสตริง
คำอธิบายเมื่อ S1> S2 ส่งคืนค่า> 0;
ฟังก์ชั่นอ้างอิง windows.Comparestring
ตัวอย่าง spinedit1.value: = ansicomparetext (edit1.text, edit2.text);
ฟังก์ชั่นส่วนหัว ansisametext (const S1, S2: สตริง): บูลีน;
ฟังก์ชั่นส่งคืนไม่ว่าสองสายเท่ากัน
บ่งบอกถึงกรณีที่ไม่รู้สึกตัว
ฟังก์ชั่นอ้างอิง sysutils.ansicomparetext
ตัวอย่าง checkbox1.Checked: = ansisametext (edit1.text, edit2.text);
ฟังก์ชั่นส่วนหัว AnsistrComp (S1, S2: PCHAR): จำนวนเต็ม;
ฟังก์ชั่นกลับมาเพื่อเปรียบเทียบสองสตริงตัวชี้
คำอธิบายเมื่อ S1> S2 ส่งคืนค่า> 0;
ฟังก์ชั่นอ้างอิงระบบการเปรียบเทียบ
ตัวอย่าง spinedit1.value: = ansistrComp (pchar (edit1.text), pchar (edit2.text))
ฟังก์ชั่นส่วนหัว Ansistricomp (S1, S2: PCHAR): จำนวนเต็ม;
ฟังก์ชั่นกลับมาเพื่อเปรียบเทียบสองสตริงตัวชี้
คำอธิบายเมื่อ S1> S2 ส่งคืนค่า> 0; เมื่อ S1 <S2 ส่งคืนค่า <0;
ฟังก์ชั่นอ้างอิง windows.Comparestring
ตัวอย่าง spinedit1.value: = ansistricomp (pchar (edit1.text), pchar (edit2.text))
ฟังก์ชั่นแรก ansistrlComp (S1, S2: PCHAR; Maxlen: Cardinal): จำนวนเต็ม;
$ [sysutils.pas
ฟังก์ชั่นกลับไปเปรียบเทียบความยาวตัวชี้สองตัวที่ระบุ
คำอธิบายเมื่อ S1> S2 ส่งคืนค่า> 0; เมื่อ S1 <S2 ส่งคืนค่า <0;
ฟังก์ชั่นอ้างอิง windows.Comparestring
ตัวอย่าง spinedit1.value: = ansistrlComp (pchar (edit1.text), pchar (edit2.text),
spinedit2.value)
ฟังก์ชั่นแรก ansistrlicomp (S1, S2: pchar; maxlen: พระคาร์ดินัล): จำนวนเต็ม;
$ [sysutils.pas
ฟังก์ชั่นกลับไปเปรียบเทียบความยาวตัวชี้สองตัวที่ระบุ
คำอธิบายเมื่อ S1> S2 ส่งคืนค่า> 0;
ฟังก์ชั่นอ้างอิง windows.Comparestring
ตัวอย่าง spinedit1.value: = ansistrlicomp (pchar (edit1.text), pchar (edit2.text),
spinedit2.value)
ฟังก์ชั่นส่วนหัว Ansistrlower (STR: PCHAR): PCHAR;
ฟังก์ชั่นส่งคืนตัวพิมพ์เล็กสตริงตัวชี้
บ่งชี้ว่าไม่มีการประมวลผลอักขระที่ไม่ใช่ capsular
ฟังก์ชั่นอ้างอิง windows.charlower
ตัวอย่าง edit2.text: = ansistrlower (pchar (edit1.text));
ฟังก์ชั่นส่วนหัว ansistrupper (str: pchar): pchar;
ฟังก์ชั่นส่งคืนตัวพิมพ์ใหญ่สตริงตัวชี้
บ่งชี้ว่าไม่ได้ประมวลผลอักขระที่ไม่ใช่ lowercase
ฟังก์ชั่นอ้างอิง windows.charupper
ตัวอย่าง edit2.text: = ansistrupper (pchar (edit1.text));
ฟังก์ชั่นแรก ansilastchar (const s: string): pchar;
ฟังก์ชั่นส่งคืนอักขระตัวชี้สุดท้ายของสตริง s
คำอธิบายเมื่อสตริง S เป็นสตริงที่ว่างเปล่าตัวชี้โมฆะจะถูกส่งคืน
ฟังก์ชั่นอ้างอิง sysutils.bytetype
ตัวอย่าง edit2.text: = ansilastchar (edit1.text);
ฟังก์ชั่นส่วนหัว ansistrlastchar (p: pchar): pchar; $ [sysutils.pas
ฟังก์ชั่นส่งคืนอักขระตัวชี้สุดท้ายของสตริงตัวชี้ p
คำอธิบายเมื่อสตริง P เป็นตัวชี้ที่ว่างเปล่ามันจะส่งคืนตัวชี้ที่ว่างเปล่า
ฟังก์ชั่นอ้างอิง sysutils.bytetype
ตัวอย่าง edit2.text: = ansilastchar (pchar (edit1.text));
ฟังก์ชั่นส่วนหัว wideuppercase (const s: wridestring): widestring; $ [sysutils.pas
ฟังก์ชั่นส่งคืนการใช้อักษรตัวพิมพ์ใหญ่ของสตริงสองไบต์
คำอธิบายอักขระสองไบต์ WideChar
ฟังก์ชั่นอ้างอิง windows.charupperbuffw
ตัวอย่าง edit2.text: = wideuppercase (edit1.text);
ฟังก์ชั่นแรก widelowercase (const s: wridestring): widestring; $ [sysutils.pas
ฟังก์ชั่นส่งคืนรูปแบบตัวพิมพ์เล็กของสตริงคู่ไบต์
หมายความว่าทำไมฉันไม่สามารถทดสอบได้
ฟังก์ชั่นอ้างอิง windows.charlowerbuffw
ตัวอย่าง edit2.text: = widelowercase (edit1.text);
ฟังก์ชั่นแรก wideComparestr (const S1, S2: กว้างที่สุด): จำนวนเต็ม;
$ [sysutils.pas
ฟังก์ชั่นการเปรียบเทียบผลตอบแทนของสองไบต์สองสาย
คำอธิบายเมื่อ S1> S2 ส่งคืนค่า> 0;
ฟังก์ชั่นอ้างอิง windows.comparestringw
ตัวอย่าง spinedit1.value: = wideComparestr (edit1.text, edit2.text);
ฟังก์ชั่นแรก Widesamestr (const S1, S2: กว้างที่สุด): บูลีน;
ฟังก์ชั่นส่งคืนไม่ว่าจะเป็นสตริงสองไบต์สองสายเท่ากัน
คำอธิบายกรณีอ่อนไหว
ฟังก์ชั่นอ้างอิง sysutils.wideComparest
ตัวอย่าง checkBox1.Checked: = Widesamestr (edit1.text, edit2.text);
ฟังก์ชั่นแรก wideComparetext (const S1, S2: กว้างที่สุด): จำนวนเต็ม;
$ [sysutils.pas
ฟังก์ชั่นการเปรียบเทียบผลตอบแทนของสองไบต์สองสาย
คำอธิบายเมื่อ S1> S2 ส่งคืนค่า> 0;
ฟังก์ชั่นอ้างอิง windows.comparestringw
ตัวอย่าง spinedit1.value: = wideComparetext (edit1.text, edit2.text);
ฟังก์ชั่นแรก Widesametext (const S1, S2: กว้างที่สุด): บูลีน;
$ [sysutils.pas
ฟังก์ชั่นส่งคืนไม่ว่าจะเป็นสตริงสองไบต์สองสายเท่ากัน
บ่งบอกถึงกรณีที่ไม่รู้สึกตัว
ฟังก์ชั่นอ้างอิง sysutils.wideComparetext
ตัวอย่าง checkBox1.Checked: = WidesAmetext (edit1.Text, edit2.text);
การตัดแต่งฟังก์ชั่นส่วนหัว (สตริง): สตริง;
การตัดแต่งฟังก์ชั่นแรก (const s: กว้างที่สุด): กว้างที่สุด;
$ [sysutils.pas
ฟังก์ชั่นส่งคืนเพื่อลบอักขระซ้ายและขวาของสตริง s
อักขระที่ระบุว่าน้อยกว่า #32 ถือเป็นอักขระที่มองไม่เห็น
อ้างถึง function system.copy
ตัวอย่าง edit2.text: = trim (edit1.text);
ฟังก์ชั่นส่วนหัว trimleft (const s: string): ulload;
ฟังก์ชั่นแรก trimleft (const s: กว้างที่สุด): กว้างที่สุด;
$ [sysutils.pas
ฟังก์ชั่นกลับมาเพื่อลบอักขระที่มองไม่เห็นทางด้านซ้ายของสตริง s
อักขระที่ระบุว่าน้อยกว่า #32 ถือเป็นอักขระที่มองไม่เห็น
อ้างถึง function system.copy
ตัวอย่าง edit2.text: = trimleft (edit1.text);
ฟังก์ชันส่วนหัว trimright (const s: string): ulload;
ฟังก์ชั่นแรก trimright (const s: widestring): กว้างที่สุด;
$ [sysutils.pas
ฟังก์ชั่นกลับมาเพื่อลบอักขระที่มองไม่เห็นทางด้านขวาของสตริง s
อักขระที่ระบุว่าน้อยกว่า #32 ถือเป็นอักขระที่มองไม่เห็น
อ้างถึง function system.copy
ตัวอย่าง edit2.text: = trimright (edit1.text);
ฟังก์ชั่นส่วนหัว quotedstr (const s: string): สตริง;
ฟังก์ชั่นส่งคืนนิพจน์ของสตริง s ใน pascal
คำอธิบาย: คำพูดเดียวในใบเสนอราคาเดียวจะถูกแปลงเป็นสอง
อ้างถึง Procedure System.Insert
ตัวอย่าง edit2.text: = quotedstr (edit1.text);
ฟังก์ชั่นแรก ansiquotedstr (const s: string; quote: char): string;
$ [sysutils.pas
ฟังก์ชั่นส่งคืนนิพจน์ของสตริง S ด้วยใบเสนอราคาเป็นคำพูด
คำอธิบาย ansiquotedstr ('hello "world',
'@') = '@hello "world@'; ansiquotedstr ('hello" world', '' ') =' "hello" "World"
ฟังก์ชั่นอ้างอิง sysutils.ansistscan
ตัวอย่าง edit2.text: = ansiquotedstr (edit1.text, '"');
ฟังก์ชั่นแรก ansiextractquotedstr (var src: pchar; quote: char): string;
$ [sysutils.pas
ฟังก์ชั่นส่งคืนรูปแบบดั้งเดิมของใบเสนอราคาเป็นคำพูด
หมายความว่า SRC ยังคงไม่เปลี่ยนแปลงเมื่อการแสดงออกผิดกฎหมาย
ฟังก์ชั่นอ้างอิง sysutils.ansistscan
ตัวอย่าง
/////////// เริ่มต้น AnsiextractQuotedstr
ขั้นตอน tform1.button1click (ผู้ส่ง: tobject);
วาจา
P: Pchar;
เริ่ม
P: = pchar (edit1.text);
edit2.text: = ansiextractquotedstr (p, '"');
EDIT3.Text: = P;
จบ;
////////// จบ ansiextractquotedstr
ฟังก์ชั่นแรก ansidequotedstr (const s: string; aquote: char): string;
$ [sysutils.pas
ฟังก์ชั่นส่งคืนรูปแบบดั้งเดิมของอักขระ aquote เป็นคำพูด
เมื่อนิพจน์ผิดกฎหมายจะส่งคืน S
ฟังก์ชั่นอ้างอิง sysutils.ansiextractquotedstr
ตัวอย่าง edit2.text: = ansidequotedstr (edit1.text, '"');
ฟังก์ชั่นแรก AdjustLineBreaks (const s: String; style: ttextlinebreakstyle =
{$ ifdef linux} tlbslf {$ endif} {$ ifdef mswindows} tlbscrlf {$ endif}):
สตริง; $ [sysutils.pas
ฟังก์ชั่นส่งคืนเพื่อปรับตัวคั่นบรรทัดของสตริงที่กำหนดเป็นลำดับ CR/LF
อธิบาย
AdjustLineBreaks ('1'#13'2 '#13) =' 1 '#13#10'2'#13#10; AdjustLineBreaks ('1'#10'2 '#10) =' 1 '#13#10#10 '2'#13#10
ฟังก์ชั่นอ้างอิง sysutils.strnextchar
ตัวอย่าง <null>
ฟังก์ชั่นส่วนหัว isvalidident (const ident: string): บูลีน;
ฟังก์ชั่นส่งคืนไม่ว่าจะเป็นตัวระบุที่ถูกต้องหรือไม่
คำอธิบายตัวระบุ :: ตัวอักษร | ขีดเส้นใต้ [ตัวอักษร | ขีดเส้นใต้ | ตัวเลข] ...
อ้างอิง <Null>
ตัวอย่างช่องทำเครื่องหมายที่ 1 ตรวจสอบ: = isvalidident (edit1.text);
ฟังก์ชั่นส่วนหัว inttoStr (ค่า: จำนวนเต็ม): สตริง;
ฟังก์ชั่นส่วนหัว inttoStr (ค่า: int64): สตริง;
ฟังก์ชั่นส่งคืนค่าจำนวนเต็มเพื่อแปลงเป็นสตริง
รูปแบบคำอธิบาย ('%d', [ค่า])
ฟังก์ชั่นอ้างอิง sysutils.fmtstr
ตัวอย่าง edit2.text: = inttoStr (spinedit1.value);
ฟังก์ชั่นแรก inttohex (ค่า: จำนวนเต็ม; ตัวเลข: จำนวนเต็ม): สตริง;
$ [sysutils.pas
ฟังก์ชั่นแรก inttoHex (ค่า: int64; ตัวเลข: จำนวนเต็ม): สตริง;
$ [sysutils.pas
ฟังก์ชั่นส่งคืนค่าจำนวนเต็มแปลงเป็นผลการดำเนินงานแบบเฮกซ์
คำอธิบายตัวเลขพารามิเตอร์ระบุความกว้างขั้นต่ำของอักขระ
ฟังก์ชั่นอ้างอิง sysutils.fmtstr
ตัวอย่าง edit2.text: = inttohex (spinedit1.value, spinedit2.value);
ฟังก์ชั่นส่วนหัว strtoint (const s: string): จำนวนเต็ม;
ฟังก์ชั่นส่งคืนสตริง S เพื่อแปลงเป็นจำนวนเต็ม
คำอธิบาย: ข้อยกเว้นจะเกิดขึ้นเมื่อสตริงแสดงโดยที่ไม่ได้รวมเข้าด้วยกัน
อ้างถึง Procedure System.val
ตัวอย่าง spinedit1.value: = strtoint (edit1.text);
ฟังก์ชันแรก strtointdef (const s: string; ค่าเริ่มต้น: จำนวนเต็ม): จำนวนเต็ม;
$ [sysutils.pas
ฟังก์ชั่นส่งคืนสตริง S เพื่อแปลงเป็นจำนวนเต็ม
ค่าเริ่มต้นจะถูกส่งคืนเมื่อสตริงถูกแสดงโดยไม่รวม
อ้างถึง Procedure System.val
ตัวอย่าง spinedit1.value: = strtointdef (edit1.text, 0);
ฟังก์ชันแรก trystrtoint (const s: string; out value: จำนวนเต็ม): บูลีน;
$ [sysutils.pas
ฟังก์ชั่นส่งคืนไม่ว่าสตริง S จะถูกแปลงเป็นค่าจำนวนเต็มสำเร็จ
คำอธิบายเท็จจะถูกส่งคืนเมื่อสตริงแสดงโดยที่ไม่ใช่จำนวนเต็มและค่าจะส่งออกเป็น 0
อ้างถึง Procedure System.val
ตัวอย่าง
/////////// เริ่มต้น trystrtoint
ขั้นตอน tform1.button1click (ผู้ส่ง: tobject);
วาจา
ฉัน: จำนวนเต็ม;
เริ่ม
ช่องทำเครื่องหมาย 1.Checked: = trystrtoint (edit1.text, i);
spinedit1.value: = i;
จบ;
/////////// สิ้นสุด trystrtoint
ฟังก์ชั่นส่วนหัว strtoint64 (const s: string): int64;
ฟังก์ชั่นส่งคืนสตริง S เพื่อแปลงเป็นจำนวนเต็มหกสิบสี่บิต
คำอธิบาย: ข้อยกเว้นจะเกิดขึ้นเมื่อสตริงถูกแสดงโดยจำนวนเต็มที่ไม่ใช่ 64 บิต
อ้างถึง Procedure System.val
ตัวอย่าง spinedit1.value: = strtoint64 (edit1.text);
ฟังก์ชั่นแรก strtoint64def (const s: string; const เริ่มต้น: int64): int64;
$ [sysutils.pas
ฟังก์ชั่นส่งคืนสตริง S เพื่อแปลงเป็นจำนวนเต็มหกสิบสี่บิต
ค่าเริ่มต้นจะถูกส่งคืนเมื่อสตริงถูกแสดงโดยจำนวนเต็มที่ไม่ใช่ 64 บิต
อ้างถึง Procedure System.val
ตัวอย่าง spinedit1.value: = strtoint64def (edit1.text, 0);
ฟังก์ชั่นแรก trystrtoint64 (const s: string; out value: int64): บูลีน;
$ [sysutils.pas
ฟังก์ชั่นส่งคืนไม่ว่าสตริง S จะถูกแปลงเป็นค่าจำนวนเต็มหกสิบสี่บิตให้สำเร็จ
คำอธิบายเท็จจะถูกส่งคืนเมื่อสตริงถูกแสดงโดยจำนวนเต็มที่ไม่ใช่หกสิบสี่บิตและค่าจะส่งออกเป็น 0
อ้างถึง Procedure System.val
ตัวอย่าง
/////////// เริ่มต้น trystrtoint64
ขั้นตอน tform1.button1click (ผู้ส่ง: tobject);
วาจา
ฉัน: int64;
เริ่ม
ช่องทำเครื่องหมายที่ 1 ตรวจสอบ: = trystrtoint64 (edit1.text, i);
spinedit1.value: = i;
จบ;
////////// END TRYSTRTOINT64
ฟังก์ชั่นแรก strtobool (const s: string): บูลีน;
ฟังก์ชั่นส่งคืนสตริง S เพื่อแปลงเป็นค่าโลจิคัล
อักขระคำอธิบายจะทำให้เกิดข้อยกเว้นเมื่อมันไม่ได้แสดงออกอย่างมีเหตุผล
ฟังก์ชั่นอ้างอิง sysutils.trystrtobool
ตัวอย่าง checkBox1.Checked: = strtobool (edit1.text);
ฟังก์ชั่นแรก strtobooldef (const s: string; const ค่าเริ่มต้น: บูลีน):
บูลีน;
ฟังก์ชั่นส่งคืนสตริง S เพื่อแปลงเป็นค่าโลจิคัล
เมื่ออธิบายอักขระจะไม่แสดงอย่างมีเหตุผลค่าเริ่มต้นจะถูกส่งคืน
ฟังก์ชั่นอ้างอิง sysutils.trystrtobool
ตัวอย่าง checkBox1.Checked: = strtobooldef (edit1.text, false);
ฟังก์ชั่นแรก trystrtobool (const s: string; out value: boolean): บูลีน;
$ [sysutils.pas
ฟังก์ชั่นส่งคืนสตริง S เพื่อแปลงเป็นค่าโลจิคัล
หมายเหตุ [หมายเหตุ] 0 เป็นเท็จไม่เป็นจริง
ฟังก์ชั่นอ้างอิง sysutils.ansisametext; var sysutils.trueboolstrs; var
sysutils.falseboolstrs
ตัวอย่าง
/////////// เริ่มต้น trystrtobool
ขั้นตอน tform1.button1click (ผู้ส่ง: tobject);
วาจา
B: บูลีน;
เริ่ม
SetLength (TrueBoolstrs, 2);
setLength (falseboolstrs, 2);
TrueBoolStrs [0]: = 'true';
falseboolstrs [0]: = 'false';
TrueBoolStrs [1]: = 'ใช่';
falseboolstrs [1]: = 'ไม่';
ช่องทำเครื่องหมาย 1.Checked: = trystrtobool (edit1.text, b);
CheckBox2.Checked: = B;
จบ;
/////////// สิ้นสุด trystrtobool
ที่แนบมา
/////////// เริ่มต้น trystrtobool
ฟังก์ชั่น trystrtobool (const s: string; out ค่า: บูลีน): บูลีน;
ฟังก์ชั่นเปรียบเทียบ (const aarray: อาร์เรย์ของสตริง): บูลีน;
วาจา
ฉัน: จำนวนเต็ม;
เริ่ม
ผลลัพธ์: = เท็จ;
สำหรับ i: = ต่ำ (aarray) ถึงสูง (aarray) ทำ
ถ้า ansisametext (s, aarray [i]) แล้ว
เริ่ม
ผลลัพธ์: = จริง;
หยุดพัก;
จบ;
จบ;
วาจา
LRESULT: ขยาย;
เริ่ม
ผลลัพธ์: = trystrtofloat (s, lresult);
หากผลลัพธ์นั้น
ค่า: = lresult <> 0
อื่น
เริ่ม
ผลลัพธ์: = จริง;
VerifyBoolStRarray;
ถ้าเปรียบเทียบ (trueboolstrs) จากนั้น
ค่า: = จริง
อื่นถ้าเปรียบเทียบ (falseboolstrs) จากนั้น
ค่า: = เท็จ
อื่น
ผลลัพธ์: = เท็จ;
จบ;
จบ;
/////////// สิ้นสุด trystrtobool
ฟังก์ชั่นแรก booltoStr (b: boolean; useboolstrs: boolean = false): string;
$ [sysutils.pas
ฟังก์ชั่นส่งคืนค่าโลจิคัล b เพื่อแปลงเป็นสตริง
คำอธิบาย booltoStr (false, false) = '0';
อ้างอิง var sysutils.trueboolstrs;
ตัวอย่าง edit1.Text: = booltoStr (checkBox1.Checked, checkBox2.Checked);
ฟังก์ชั่นส่วนหัว loadstr (Ident: Integer): String;
ฟังก์ชั่นส่งคืนทรัพยากรสตริงขึ้นอยู่กับตัวระบุตัวตน
คำอธิบายทรัพยากรสตริงหมายถึงทรัพยากรภายในของโปรแกรม
ฟังก์ชั่นอ้างอิง sysutils.findstringResource
ตัวอย่าง edit2.text: = loadStr (strTointDef (edit1.Text, 0));
ฟังก์ชั่นแรก fmtloadstr (Ident: Integer; const args: อาร์เรย์ของ const):
สตริง; $ [sysutils.pas
ฟังก์ชั่นส่งคืนทรัพยากรสตริงที่จัดรูปแบบ
คำอธิบายทรัพยากรสตริงหมายถึงทรัพยากรภายในของโปรแกรม
ฟังก์ชั่นอ้างอิง sysutils.fmtstr; ฟังก์ชั่น sysutils.findstringResource
ตัวอย่าง <null>;
ฟังก์ชั่นส่วนหัว strlen (const str: pchar): พระคาร์ดินัล;
ฟังก์ชั่นส่งคืนความยาวของสตริงตัวชี้
คำอธิบาย: เมื่อสตริงตัวชี้ Str เป็นไม่มีข้อยกเว้นจะถูกเรียกใช้
อ้างอิง <Null>
ตัวอย่าง spinedit2.value: = strlen (pchar (edit1.text));
ฟังก์ชั่นส่วนหัว (const str: pchar): pchar;
ฟังก์ชั่นส่งคืนสิ้นสุดของสตริงตัวชี้
คำอธิบาย: เมื่อสตริงตัวชี้ Str เป็นไม่มีข้อยกเว้นจะถูกเรียกใช้
อ้างอิง <Null>
ตัวอย่าง edit2.text: = strend (pchar (edit1.text)) - spinedit1.value;
ฟังก์ชั่นแรก strmove (dest: pchar; const ที่มา: pchar; count: cardinal):
pchar; $ [sysutils.pas
ฟังก์ชั่นส่งคืนการคัดลอกสตริงตัวชี้จำนวนหน่วยความจำที่ระบุนับจำนวนเงินไปยังสตริงตัวชี้
บ่งชี้ว่า Dest ยังไม่ได้จัดสรรทรัพยากรจะเรียกใช้ข้อยกเว้น s
อ้างถึง function system.move
ตัวอย่าง
///////// เริ่มต้น strmove
ขั้นตอน tform1.button1click (ผู้ส่ง: tobject);
วาจา
VBUFFER: PCHAR;
เริ่ม
vbuffer: = '0123456789';
strmove (vbuffer, pchar (edit1.text), spinedit1.value);
edit2.text: = vbuffer;
จบ;
////////// end strmove
ฟังก์ชั่นแรก strcopy (dest: pchar; const ที่มา: pchar): pchar;
$ [sysutils.pas
ฟังก์ชั่นส่งคืนคัดลอกแหล่งสตริงตัวชี้ลงในสตริงตัวชี้ปลายทาง
บ่งชี้ว่าปลายทางควรจัดสรรพื้นที่เพียงพอแล้วข้อยกเว้นจะถูกเรียกใช้
อ้างอิง <Null>
ตัวอย่าง
/////////// เริ่มต้น strcopy
ขั้นตอน tform1.button1click (ผู้ส่ง: tobject);
วาจา
VBUFFER: PCHAR;
เริ่ม
getMem (vbuffer, ความยาว (edit1.text) + 1);
strcopy (vbuffer, pchar (edit1.text));
edit2.text: = vbuffer;
Freemem (Vbuffer);
จบ;
/////////// end strcopy
ฟังก์ชั่นแรก strecopy (dest: pchar; const ที่มา: pchar): pchar;
$ [sysutils.pas
ฟังก์ชั่นส่งคืนสำเนาของแหล่งที่มาสตริงตัวชี้ไปที่ส่วนท้ายของสตริงตัวชี้
คำแนะนำที่สามารถเชื่อมต่อสตริงตัวชี้
อ้างอิง <Null>
ตัวอย่าง
/////////// เริ่มต้น strecopy
ขั้นตอน tform1.button1click (ผู้ส่ง: tobject);
วาจา
Vbuffer: Array [0..255] ของ Char;
เริ่ม
strecopy (strecopy (vbuffer, pchar (edit1.text)), pchar (edit2.text));
EDIT3.Text: = VBuffer;
จบ;
/////////// end strecopy
ฟังก์ชั่นแรก strlcopy (dest: pchar; const ที่มา: pchar; maxlen: cardinal):
pchar; $ [sysutils.pas
ฟังก์ชั่นส่งคืนแหล่งที่มาของสตริงตัวชี้ที่ระบุความยาว maxlen ไปยัง dest String pointer
บ่งชี้ว่าปลายทางควรจัดสรรพื้นที่เพียงพอแล้วข้อยกเว้นจะถูกเรียกใช้
อ้างอิง <Null>
ตัวอย่าง
/////////// เริ่มต้น strlcopy
ขั้นตอน tform1.button1click (ผู้ส่ง: tobject);
วาจา
Vbuffer: Array [0..255] ของ Char;
เริ่ม
strlcopy (vbuffer, pchar (edit1.text), spinedit1.value);
edit2.text: = vbuffer;
จบ;
/////////// end strlcopy
首部function StrPCopy(Dest: PChar; const Source: string): PChar;
$[SysUtils.pas
功能返回将指针字符串Source复制到指针字符串Dest中
说明StrLCopy(Dest, PChar(Source), Length(Source))
参考function SysUtils.StrLCopy
ตัวอย่าง
///////Begin StrPCopy
ขั้นตอน tform1.button1click (ผู้ส่ง: tobject);
วาจา
vBuffer: array[0..255] of Char;
เริ่ม
StrPCopy(vBuffer, PChar(Edit1.Text));
Edit2.Text := vBuffer;
จบ;
///////End StrPCopy
首部function StrPLCopy(Dest: PChar; const Source: string; MaxLen:
Cardinal): PChar; $[SysUtils.pas
功能返回将字符串Source指定长度MaxLen复制到指针字符串Dest中
说明StrLCopy(Dest, PChar(Source), MaxLen)
参考function SysUtils.StrLCopy
ตัวอย่าง
///////Begin StrPLCopy
ขั้นตอน tform1.button1click (ผู้ส่ง: tobject);
วาจา
vBuffer: array[0..255] of Char;
เริ่ม
StrPLCopy(vBuffer, Edit1.Text, SpinEdit1.Value);
Edit2.Text := vBuffer;
จบ;
///////End StrPLCopy
首部function StrCat(Dest: PChar; const Source: PChar): PChar;
$[SysUtils.pas
功能返回连接指针字符串Dest和指针字符串Source
说明StrCopy(StrEnd(Dest), Source)
参考function SysUntils.StrCopy
ตัวอย่าง
///////Begin StrCat
ขั้นตอน tform1.button1click (ผู้ส่ง: tobject);
วาจา
vBuffer: array[0..255] of Char;
เริ่ม
StrPCopy(vBuffer, Edit1.Text);
StrCat(vBuffer, PChar(Edit2.Text));
Edit3.Text := vBuffer;
จบ;
///////End StrCat
首部function StrLCat(Dest: PChar; const Source: PChar; MaxLen: Cardinal):
PChar; $[SysUtils.pas
功能返回连接指针字符串Dest和指针字符串Source
说明[注意]MaxLen指定连接后的最大长度不是指针字符串Source的长度
参考<NULL>
ตัวอย่าง
///////Begin StrLCat
ขั้นตอน tform1.button1click (ผู้ส่ง: tobject);
วาจา
vBuffer: array[0..255] of Char;
เริ่ม
StrPCopy(vBuffer, Edit1.Text);
StrLCat(vBuffer, PChar(Edit2.Text), SpinEdit1.Value);
Edit3.Text := vBuffer;
จบ;
///////End StrLCat
首部function StrComp(const Str1, Str2: PChar): Integer; $[SysUtils.pas
功能返回比较两个指针字符串
说明当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;区分大小写;[注意]返回第一个出现不同字符的差异
参考<NULL>
例子SpinEdit1.Value := StrComp(PChar(Edit1.Text), PChar(Edit2.Text));
首部function StrIComp(const Str1, Str2: PChar): Integer; $[SysUtils.pas
功能返回比较两个指针字符串
说明当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;不区分大小写;[注意]返回第一个出现不同字符的差异
参考<NULL>
例子SpinEdit1.Value := StrIComp(PChar(Edit1.Text), PChar(Edit2.Text));
首部function StrLComp(const Str1, Str2: PChar; MaxLen: Cardinal): Integer;
$[SysUtils.pas
功能返回比较两个指针字符串指定长度
说明当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;区分大小写;Length(长度);[注意]返回第一个出现不同字符的差异
参考<NULL>
例子SpinEdit1.Value := StrLComp(PChar(Edit1.Text), PChar(Edit2.Text),
SpinEdit2.Value)
首部function StrLIComp(const Str1, Str2: PChar; MaxLen: Cardinal): Integer;
$[SysUtils.pas
功能返回比较两个指针字符串指定长度
说明当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;不区分大小写;[注意]返回第一个出现不同字符的差异
参考<NULL>
例子SpinEdit1.Value := StrLIComp(PChar(Edit1.Text), PChar(Edit2.Text),
SpinEdit2.Value)
首部function StrScan(const Str: PChar; Chr: Char): PChar; $[SysUtils.pas
功能返回在指针字符串Str搜索字符Chr第一个出现的地址
说明没有找到则返回空指针
参考<NULL>
例子Edit2.Text := StrScan(PChar(Edit1.Text), '*');
首部function StrRScan(const Str: PChar; Chr: Char): PChar; $[SysUtils.pas
功能返回在指针字符串Str搜索字符Chr最后一个出现的地址
说明没有找到则返回空指针
参考<NULL>
例子Edit2.Text := StrRScan(PChar(Edit1.Text), '*');
首部function StrPos(const Str1, Str2: PChar): PChar; $[SysUtils.pas
功能返回指针字符串Str2在Str1中第一个出现的地址
说明没有找到则返回空指针;StrPos('12345', '3') = '345'
参考<NULL>
例子Edit3.Text := StrPos(PChar(Edit1.Text), PChar(