s:=copy(s,2,3);(字符串,从第几位开始,取几位)
解决方案 »
- 跨程序操作TWebBrowser失败的问题
- 怎么安装DosMove控件?
- 怎样屏蔽或取消双击树型节点的展开与收缩功能?
- 如何用正则提取包含特定字符串的网址
- installshield8.0打包安装数据库
- 怎样让listbox上的项全都成为被选中的状态(listbox已设为允许多选)
- 求一个将数值转换为大写的代码.
- 急!在NT Application Service程序里如何取得当前程序的路径?(用GetDir得到的是Window Service控制台程序的路径?!)
- 向DBGrid的数据源添加数据时,怎样让DBGrid暂时不刷新?
- 怎樣查找AdvStringGrid 里面的內容
- 有关远程控制的????????
- 请问有关:鼠标右键弹出菜单问题!
function Copy(S; Index, Count: Integer): array;DescriptionS is an expression of a string or dynamic-array type. Index and Count are integer-type expressions. Copy returns a substring or sub array containing Count characters or elements starting at S[Index]. If Index is larger than the length of S, Copy returns an empty string or array.If Count specifies more characters or array elements than are available, only the characters or elements from S[Index] to the end of S are returned.Note: When S is a dynamic array, Copy can only be used as a parameter in a call to a procedure or function that expects an array parameter. That is, it acts like the Slice function when working with dynamic arrays.
Pos(子串:string,源字符串:string); //获得子串在源字符串的位置
begin
Result := Copy(S, Index, Length(S) - Index +1);
end;function LeftStr(S: String; Len: Integer): String;
begin
Result := Copy(S, 1, Len);
end;function RightStr(S: String; Len: Integer): String;
begin
Result := Copy(S, Length(S) - Len +1, Len);
end;