<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Lazarus - Remove all (non)numbers from a string - Delphi, Lazarus, Free Pascal				            </title>
            <link>https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/lazarus-remove-all-nonnumbers-from-a-string/</link>
            <description>Tweaking4All.com Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Wed, 17 Jun 2026 03:48:24 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: Lazarus - Remove all (non)numbers from a string</title>
                        <link>https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/lazarus-remove-all-nonnumbers-from-a-string/#post-5807</link>
                        <pubDate>Wed, 02 Apr 2025 08:21:33 +0000</pubDate>
                        <description><![CDATA[If you only want to grab all the numbers until you reach a non-number (eg: 123example456 -&gt; 123) then this will do the trick:
  function RemoveAllNonNumbers(aText:string):string;
  var...]]></description>
                        <content:encoded><![CDATA[<p>If you only want to grab all the numbers until you reach a non-number (eg: 123example456 -&gt; 123) then this will do the trick:</p>
<pre contenteditable="false">  function RemoveAllNonNumbers(aText:string):string;
  var
    Character : Char;
  begin
    Result := '';

    for Character in aText do
      if CharInSet(Character,) then
        Result := Result + Character
      else
        exit;
  end;    </pre>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/">Delphi, Lazarus, Free Pascal</category>                        <dc:creator>Hans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/lazarus-remove-all-nonnumbers-from-a-string/#post-5807</guid>
                    </item>
				                    <item>
                        <title>Lazarus - Remove all (non)numbers from a string</title>
                        <link>https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/lazarus-remove-all-nonnumbers-from-a-string/#post-484</link>
                        <pubDate>Fri, 31 Aug 2018 06:30:01 +0000</pubDate>
                        <description><![CDATA[When writing one of my small applications I ran into the issue that I had to remove all non-numbers from a string.I came up with this little function and thought it may be useful to others. ...]]></description>
                        <content:encoded><![CDATA[<p>When writing one of my small applications I ran into the issue that I had to remove all non-numbers from a string.<br />I came up with this little function and thought it may be useful to others. <br />I've also added an example for those who only want to remove numbers from a string (so the opposite).</p>
<pre contenteditable="false">function RemoveAllNonNumbers(aText:string):string;<br />var<br />  Character:Char;<br />begin<br />  for Character in aText do<br />    if CharInSet(Character,) then<br />      Result := Result + Character;<br />end;      </pre>
<p>The opposite:</p>
<pre contenteditable="false">function RemoveAllNumbers(aText:string):string;<br />var<br />  Character:Char;<br />begin<br />  for Character in aText do<br />    if not CharInSet(Character,) then<br />      Result := Result + Character;<br />end; </pre>
<p>Hope this is useful to someone <img class="t4a_smiley" src="https://www.tweaking4all.com/wp-content/themes/tweaking4all/css/images/emoticons/t4a_smile.png" alt="" width="32" height="32" /></p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/">Delphi, Lazarus, Free Pascal</category>                        <dc:creator>Hans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/delphi-lazarus-free-pascal/lazarus-remove-all-nonnumbers-from-a-string/#post-484</guid>
                    </item>
							        </channel>
        </rss>
		