SaveTo StringHelper?
问题 I need a StringHelper which saves a string to a file: var s: string; begin s := 'Some text'; s.SaveTo('C:\MyText.txt'); end; Unfortunately, this is not possible. Is it possible to add such a StringHelper? 回答1: It is possible to add such a helper. For instance: type TMyStringHelper = record helper for string procedure SaveTo(const FileName: string); end; The downside to doing so is that this will replace the string helper that is provided by the RTL. If you don't use it, that won't matter. If