网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > C/C++
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.1999年4月基础知识知识和C语言程.
.Windows中控制台程序的全屏模式开.
.使用VC++ ATL实现Office的COM插件.
.扑克牌的发牌程序(用伪随机数实.
.BitBlt()双缓冲解决图象闪烁.
.C语言中的面向对象(3)-类模拟的.
.九九乘法表的几种不同形状.
.C++ Builder 初学问与答(八).
.C/C++编程新手错误语录(续二).
.在CB中实现流类的版本控制.
.轻轻松松从C一路走到C++系列文章.
.实现C语言高效编程的四大秘技.
.Visual FoxPro 9.0更强大了.
.COM组件设计与应用之实现多接口.
.Visual C++利用多线程模拟并行计.
.在Visual Studio.NET中使用Cryst.
.C++如何处理内联虚函数.
.C++编译器如何实现异常处理.
.修练8年C++面向对象程序设计之体.
.TDateTime.

Delphi6函数大全(2)

发表日期:2008-3-8



  首部 function RightStr(const AText: string; const ACount: Integer): string; $[StrUtils.pas
功能 返回字符串AText右边的ACount个字符
说明 RightStr('123456', 3) = '456'

参考 function System.Copy
例子 Edit3.Text := RightStr(Edit1.Text, SpinEdit1.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function MidStr(const AText: string; const AStart, ACount: Integer): string; $[StrUtils.pas
功能 返回字符串AText从AStart开始的ACount个字符
说明 其实就是Copy
参考 function System.Copy
例子 Edit3.Text := MidStr(Edit1.Text, SpinEdit1.Value, SpinEdit2.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function SearchBuf(Buf: PChar; BufLen: Integer; SelStart, SelLength: Integer; SearchString: String; Options: TStringSearchOptions = [soDown]): PChar; $[StrUtils.pas
功能 返回第一个搜索到的指针位置
说明 这函数常用于文本中搜索字符串
参考 <NULL>
例子
///////Begin SearchBuf
function SearchEdit(EditControl: TCustomEdit; const SearchString: String;
SearchOptions: TStringSearchOptions; FindFirst: Boolean = False): Boolean;
var
Buffer, P: PChar;
Size: Word;
begin
Result := False;
if (Length(SearchString) = 0) then Exit;
Size := EditControl.GetTextLen;
if (Size = 0) then Exit;
Buffer := StrAlloc(Size + 1);
try
EditControl.GetTextBuf(Buffer, Size + 1);
P := SearchBuf(Buffer, Size, EditControl.SelStart, EditControl.SelLength,
SearchString, SearchOptions);
if P <> nil then begin
EditControl.SelStart := P - Buffer;
EditControl.SelLength := Length(SearchString);
Result := True;
end;
finally
StrDispose(Buffer);
end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
SearchOptions: TStringSearchOptions;
begin
SearchOptions := [];
if CheckBox1.Checked then
Include(SearchOptions, soDown);
if CheckBox2.Checked then
Include(SearchOptions, soMatchCase);
if CheckBox3.Checked then
Include(SearchOptions, soWholeWord);
SearchEdit(Memo1, Edit1.Text, SearchOptions);
Memo1.SetFocus;
end;
///////End SearchBuf
━━━━━━━━━━━━━━━━━━━━━
首部 function Soundex(const AText: string; ALength: TSoundexLength = 4): string; $[StrUtils.pas
功能 返回探测字符串
说明 根据探测法(Soundex)可以找到相进的字符串;http://www.nara.gov/genealogy/coding.Html
参考 <NULL>
例子 Edit2.Text := Soundex(Edit1.Text, SpinEdit1.Value);

━━━━━━━━━━━━━━━━━━━━━
首部 function SoundexInt(const AText: string; ALength: TSoundexIntLength = 4): Integer; $[StrUtils.pas
功能 返回探测整数
说明 ALength的值越大解码准确率越高
参考 <NULL>
例子 SpinEdit2.Value := SoundexInt(Edit1.Text, SpinEdit1.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function DecodeSoundexInt(AValue: Integer): string; $[StrUtils.pas
功能 返回探测整数的解码
说明 DecodeSoundexInt(SoundexInt('hello')) 相当于 Soundex('hello')
参考 <NULL>
例子 Edit2.Text := DecodeSoundexInt(SpinEdit2.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function SoundexWord(const AText: string): Word; $[StrUtils.pas
功能 返回探测文字数值
说明 没有参数ALength已经固定为4
参考 <NULL>
例子 SpinEdit2.Value := SoundexWord(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部 function DecodeSoundexWord(AValue: Word): string; $[StrUtils.pas
功能 返回探测文字数值的解码
说明 DecodeSoundexWord(SoundexWord('hello')) 相当于 Soundex('hello')
参考 <NULL>
例子 Edit2.Text := DecodeSoundexWord(SpinEdit2.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function SoundexSimilar(const AText, AOther: string; ALength: TSoundexLength = 4): Boolean; $[StrUtils.pas
功能 返回两个字符串的探测字符串是否相同
说明 Result := Soundex(AText, ALength) = Soundex(AOther, ALength)
参考 <NULL>
例子 CheckBox1.Checked := SoundexSimilar(Edit1.Text, Edit2.Text, SpinEdit1.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function SoundexCompare(const AText, AOther: string; ALength: TSoundexLength = 4): Integer; $[StrUtils.pas
功能 返回比较两个字符串的探测字符串的结果
说明 Result := AnsiCompareStr(Soundex(AText, ALength), Soundex(AOther, ALength))
参考 function SysUtils.AnsiCompareStr
例子 SpinEdit2.Value := SoundexCompare(Edit1.Text, Edit2.Text, SpinEdit1.Value);
━━━━━━━━━━━━━━━━━━━━━
首部 function SoundeXProc(const AText, AOther: string): Boolean; $[StrUtils.pas
功能 调用SoundexSimilar返回两个字符串的探测字符串是否相同
说明 系统变量AnsiResemblesProc的默认值
参考 function StrUtils.AnsiResemblesText
例子 [var AnsiResemblesProc: TCompareTextProc = SoundexProc;]
上一篇:就c++中的const限定修饰符做一个入门的教程 人气:357
下一篇:谈跨平台C++动态连接库的实现 人气:530
浏览全部C/C++的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐