delphi将两个Strlist合并,求交集 (保留相同的)
Function StrList_Join(StrListA,StrListB:String):String; //将两个Strlist合并,求交集 (保留相同的)
var SListA,SListB,SListC:TStringList;
i:Integer;
begin
Result := '';
Try
SListA := TStringList.Create;
SListB := TStringList.Create;
SListC := TStringList.Create;
SListA.CommaText := StrListA; SListB.CommaText := StrListB;
for i:=0 to SListA.Count-1 do begin
if SListB.IndexOf(SListA[i])>=0 then SListC.Add(SListA[i]);
end;
Result := SListC.CommaText;
Finally
FreeAndNil(SListA); FreeAndNil(SListB); FreeAndNil(SListC);
end;
end;
delphi将两个Strlist合并,求交集 (保留相同的)的更多相关文章
- delphi将两个Strlist合并,求并集
Function StrList_Merge(StrListA,StrListB:String):String; //将两个Strlist合并,求并集 var SListA,SListB,SListC ...
- 两个ArrayList之间求交并补
class ArraylistCalculate{ // 两个整数集求差集 public ArrayList<Integer> integerArrayListDifference( Ar ...
- python 两个list 求交集,并集,差集
def diff(listA,listB): #求交集的两种方式 retA = [i for i in listA if i in listB] retB = list(set(listA).inte ...
- python中对两个 list 求交集,并集和差集
python中对两个 list 求交集,并集和差集: 1.首先是较为浅白的做法: >>> a=[1,2,3,4,5,6,7,8,9,10] >>> b=[1,2,3 ...
- 求两个Linux文本文件的交集、差集、并集
一.交集 sort a.txt b.txt | uniq -d 二.并集 sort a.txt b.txt | uniq 三.差集 a.txt-b.txt: sort a.txt b.txt b.tx ...
- Linux 两个文件求交集、并集、差集
一.交集 sort a.txt b.txt | uniq -d 二.并集 sort a.txt b.txt | uniq 三.差集 a.txt-b.txt: sort a.txt b.txt b.tx ...
- 【转载】C#编程中两个List集合使用Intersect方法求交集
在C#语言程序设计中,List集合是常用的集合数据类型,在涉及集合类型的运算中,有时候我们需要计算2个List集合中共有的数据,即对2个List集合求交集运算.此时可以使用C#语言提供的Interse ...
- sql求两表的并集、交集、非交集、差集、结果集排序
create table A( id ,) Not null primary key, name ) not null default(''), ) INSERT INTO [A]([name]) V ...
- PHP计算两个时间段是否有交集(边界重叠不算)
优化前的版本: /** * PHP计算两个时间段是否有交集(边界重叠不算) * * @param string $beginTime1 开始时间1 * @param string $endTime1 ...
随机推荐
- Python 常用内置模块详解
Python 的创始人为吉多·范罗苏姆(Guido van Rossum).1989年的圣诞节期间,吉多·范罗苏姆为了在阿姆斯特丹打发时间,决心开发一个新的脚本解释程序,作为ABC语言的一种继承.Py ...
- c++11 用户定义字面量
c++11 用户定义字面量 #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <string> #inc ...
- Makefile中 -I -L -l区别
我们用gcc编译程序时,可能会用到"-I"(大写i),"-L"(大写l),"-l"(小写l)等参数,下面做个记录: 例: gcc -o he ...
- Webpack4 splitChunks配置,代码分离逻辑
博客不知道啥时候写的了,一直在草稿箱没写完,突然感觉今年过去大半了,又没怎么写博客.写写完,有始有终 1.代码分离升级 原来项目代码分离是通过下面的配置,基于bundle-loader插件,通过rou ...
- Spring源码解析 - springMVC核心代码
一.首先来讲解下springMVC的底层工作流程 1.首先我们重点放在前端控制器(DispatcherServlet) 其类图: 因为从流程图看,用户的请求最先到达就是DispatcherServle ...
- PHP扩展模块php_igbinary和php_redis的安装
php_igbinary : 在序列化和反序列化的效率上高于其自带的 php_redis :效率是相当高有链表排序功能 详情略 安装之前要准备 百度网盘: wampserver2.5-A ...
- 【Java并发】基础
一.概述 1.1 线程与进程区别 1.2 多线程引发的性能问题 二.多线程创建方式 2.1 第一种-继承Thread类 2.2 第二种-实现Runnable接口 2.3 第三种-实现Callable接 ...
- python爬取豆瓣电影信息数据
题外话+ 大家好啊,最近自己在做一个属于自己的博客网站(准备辞职回家养老了,明年再战)在家里 琐事也很多, 加上自己 一回到家就懒了(主要是家里冷啊! 广东十几度,老家几度,躲在被窝瑟瑟发抖,) 由于 ...
- PAT Advanced 1153 Decode Registration Card of PAT (25 分)
A registration card number of PAT consists of 4 parts: the 1st letter represents the test level, nam ...
- Python:出现UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc9 in position 0: invalid continuation byte问题
我在导入一个csv文件的时候出现了一个问题 报错的内容是这样的: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc9 in positio ...