title: Delphi: search string in a TStringList
body: <p>I have a large txt (ipaddress.txt) with a lot of lines, each line is a IP Address, eg.:</p>
  
  <pre><code>44.XXX.XXX.XXX
  45.XXX.XXX.XXX
  46.XXX.XXX.XXX
  47.XXX.XXX.XXX
  48.XXX.XXX.XXX
  </code></pre>
  
  <p>i load this list in a <code>TStringList</code>, eg.:</p>
  
  <pre><code>FIpAddressList := TStringList.Create();
  FIpAddressList.Sorted := true;
  FIpAddressList.LoadFromFile('ipaddress.txt');
  </code></pre>
  
  <p>and i want check if a IP Address is in the list, eg.:</p>
  
  <pre><code>function IsIPinList(const IPAddress : string): Boolean;
  begin
     Result := (FIpAddressList.IndexOf(IPAddress) &lt;&gt; -1);
  end;
  </code></pre>
  
  <p>it works... but is slow with huge <code>TStringList</code>.</p>
  
  <p>Is there any way to make this process faster?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <ul>
  <li>The list is static with monthly update, with less or more 5'000 lines. </li>
  <li>The function is invoked at each request on a server (eg. 5 times per seconds).</li>
  <li><s>The list is loaded only when the server service start.</s></li>
  </ul>