Delphi xe8 分割字符串太方便了

procedure TForm1.Button2Click(Sender: TObject);
var
  m_Str: string;
  m_StrList: TArray<string>;
  I:Integer;
begin
  m_Str := Memo1.Text;
  m_StrList := m_Str.Split([‘n你好‘, ‘啊&‘]);
  for I := 0 to High(m_StrList) do
  begin
    Memo1.Lines.Add(m_StrList[I]);
  end;
end;

时间: 2024-08-13 03:49:26

Delphi xe8 分割字符串太方便了的相关文章

Fabric自动部署太方便了

之前不知道有Fabric工具,每次发布程序到服务器上的时候,基本流程:本地打包程序 -> Ftp上传 -> 停服务器Apache -> 覆盖文件 -> 启动Apache, 非常繁琐. 前几天无意发现了Fabric工具,研究了一下,现在我通过该工具发布程序只要一条指令即可: fab pack deploy 具体如何实现的,请看实例,你只需要在你的程序跟目录下添加fabfile.py文件,内容参考如下: #!/usr/bin/env python from fabric.api imp

httpd+dnsmasq+kickstart部署系统真是太方便了

弄个虚机桥接一下,装系统那叫一个方便! 搭建这样一个kickstart平台非常简单快捷,只需要用yum装个dnsmasq就万事大吉了. #dnsmasq的配置文件以下行的注释去掉,并修改dhcp范围和tftp的根目录. bogus-privfilterwin2kinterface=eth0dhcp-range=192.168.44.100,192.168.44.120,12hdhcp-boot=pxelinux.0enable-tftptftp-root=/var/ftpddhcp-author

Excel使用技巧之分割字符串

1.问题描述 项目中原来写了一大堆的配置,格式如下(下面只是部分,总共有500行左右): InitMap<BlankColumn>(iColumnBlank, "空白分栏", g); InitMap<RulerColumn>(iColumnRuler, "标尺分栏", g); InitMap<LogFormationColumn>(iColumnLogFormation, "地层分层分栏", g); InitM

Delphi中stringlist分割字符串的用法

Delphi中stringlist分割字符串的用法 TStrings是一个抽象类,在实际开发中,是除了基本类型外,应用得最多的. 常规的用法大家都知道,现在来讨论它的一些高级的用法. 1.CommaText 2.Delimiter &DelimitedText 3.Names &Values &ValueFromIndex 先看第一个:CommaText.怎么用呢? const constr :String = 'aaa,bbb,ccc,ddd'; var strs :TStrin

分割字符串 ExtractStrings

//分割字符串 ExtractStrings var s: String; List: TStringList; begin s := 'about: #delphi; #pascal, programming'; List := TStringList.Create; ExtractStrings([';',',',':'],['#',' '],PChar(s),List); //第一个参数是分隔符; 第二个参数是开头被忽略的字符 ShowMessage(List.Text); //about

分割字符串

#include <stdio.h> #include <string.h> /* 分割字符串 */ int main(void){ char s[100] = "123-456-789-abc-edf"; //strtok第一次调用的时候,第一个参数是字符串, //但第二次调用的时候,第一个参数是NULL const char *buf =strtok(s,"-"); while(buf){ printf("%s\n",

php分割字符串

php分割字符串的函数 1,substr $str1 = substr($str,5); echo "从第5个字符开始取至最后:".$str1."; $str2 = substr($str,9,4); echo "从第9个字符开始取4个字符:".$str2."; $str3 = substr($str,-5); echo "取倒数5个字符:".$str3."; $str4 = substr($str,-8,4); e

关于Delphi中的字符串的详细分析

关于Delphi中的字符串的详细分析 只是浅浅的解析下,让大家可以快速的理解字符串. 其中的所有代码均在Delphi7下测试通过. Delphi 4,5,6,7中有字符串类型包括了: 短字符串(Short String) 长字符串(Long String) 宽字符串(Wide String) 零结尾字符串(Null-Terminated String).PChar和字符数组 1.短字符串(Short String) 固 定长度,最大字符数个数为255,短字符串也成为长度字节(Length-byt

咏南C/S开发框架支持最新的DELPHI XE8开发

特大好消息:咏南C/S开发框架支持最新的DELPHI XE8开发!咏南开发框架让你再无开发工具升级后顾之忧! 购买咏南开发框架送项目源码!