在delphi中哪个函数类似SQL中的substring函数?(马上结单)

downkey 2003-12-11 11:08:27
在delphi中哪个函数类似SQL中的substring函数?(马上结单)
...全文
249 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
nxfbccu 2003-12-11
  • 打赏
  • 举报
回复
Copy(SourceStr, Index, Count)
manfeng 2003-12-11
  • 打赏
  • 举报
回复
if copy(trim(memo1.text),1,2)='解除' then
jmf2000 2003-12-11
  • 打赏
  • 举报
回复
COPY!!!!
gencan 2003-12-11
  • 打赏
  • 举报
回复
copy(trim(memo1.text),1,2);
mbzdh 2003-12-11
  • 打赏
  • 举报
回复
COPY就可以了
如 COPY(原字符, 从第几位开始,取几位);

copy('yourstr',3,2)则返回值为ur
downkey 2003-12-11
  • 打赏
  • 举报
回复
有没有一个函数直接返回子串?
ExploiterSoft 2003-12-11
  • 打赏
  • 举报
回复
var
v : Integer;
s : String;
b : Boolean;
begin
B := False;
for v := Memo1.Lines.count - 1 downto 0 do
begin
s := Memo1.Lines[v].String;
AnsiReplaceStr(s,#13#10,'');
if AnsiContainsStr(s,'解除') then
begin
B := True;
Break;
end
end;
if Not B then
ShowMessage('没有') else
ShowMessage('有');
end;

应该是这样,直接写的;
downkey 2003-12-11
  • 打赏
  • 举报
回复
我的意思是返回memo1.text文本中有没有,'解除'两个字?
ExploiterSoft 2003-12-11
  • 打赏
  • 举报
回复
uses
StrUtils

function IfThen(AValue: Boolean; const ATrue: string;
AFalse: string = ''): string; overload;

{ Basic-like functions / Left, Right, Mid }

function LeftStr(const AText: AnsiString; const ACount: Integer): AnsiString; overload;
function LeftStr(const AText: WideString; const ACount: Integer): WideString; overload;

function RightStr(const AText: AnsiString; const ACount: Integer): AnsiString; overload;
function RightStr(const AText: WideString; const ACount: Integer): WideString; overload;

function MidStr(const AText: AnsiString; const AStart, ACount: Integer): AnsiString; overload;
function MidStr(const AText: WideString; const AStart, ACount: Integer): WideString; overload;

{ Basic-like functions / LeftB, RightB, MidB
these functions don't care locale information.
}

function LeftBStr(const AText: AnsiString; const AByteCount: Integer): AnsiString;
function RightBStr(const AText: AnsiString; const AByteCount: Integer): AnsiString;
function MidBStr(const AText: AnsiString; const AByteStart, AByteCount: Integer): AnsiString;

{ Basic-like functions / Delphi style function name }

function AnsiLeftStr(const AText: AnsiString; const ACount: Integer): AnsiString;
function AnsiRightStr(const AText: AnsiString; const ACount: Integer): AnsiString;
function AnsiMidStr(const AText: AnsiString; const AStart, ACount: Integer): AnsiString;
downkey 2003-12-11
  • 打赏
  • 举报
回复
我是想用delphi中的函数,替换SQL中的函数
if substring(trim(memo1.text),1,2)='解除' then
______________________________
画虚线处为SQL中的函数,用delphi函数怎么替换?
yangbing3102 2003-12-11
  • 打赏
  • 举报
回复
copy(sourcestring,startindex,long);
ltmb118 2003-12-11
  • 打赏
  • 举报
回复
copy
heizi99 2003-12-11
  • 打赏
  • 举报
回复
pos
copy
一笑天下而已 2003-12-11
  • 打赏
  • 举报
回复
copy
「已注销」 2003-12-11
  • 打赏
  • 举报
回复
function Copy(S; Index, Count: Integer): string;
function Copy(S; Index, Count: Integer): array;

5,939

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧