TStringList与TList< string> [英] TStringList vs. TList<string>

查看:186
本文介绍了TStringList与TList< string>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用标准有什么区别

type 
  sl: TStringList 

与使用通用TList相比

compared to using a generic TList

type 
  sl: TList<string>

看到,两者的行为完全一样。

As far as I can see, both behave exactly the same.

这只是另一种做同样的事情吗?

Is it just another way of doing the same thing?

是有些情况会比另一个更好吗?

Are there situations where one would be better than the other?

谢谢!

推荐答案


  • TStringList是TStrings的后代。

  • TStringList知道如何按字母顺序排序。

  • TStringList有一个Objects属性。

  • TStringList不会使您的代码与以前所有版本的Delphi不兼容。

  • 可以将TStringList用作已发布的属性。 (现在,一个bug阻止了泛型类的发布。)

    • TStringList is a descendant of TStrings.
    • TStringList knows how to sort itself alphabetically.
    • TStringList has an Objects property.
    • TStringList doesn't make your code incompatible with all previous versions of Delphi.
    • TStringList can be used as a published property. (A bug prevents generic classes from being published, for now.)
    • 这篇关于TStringList与TList&lt; string&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆