<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic remove space from string in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799581#M37066</link>
    <description>First define what you mean by 'the end of the string'.&lt;BR /&gt;&lt;BR /&gt;Fortran strings may be defined as ending 'at the character before a 
continuous run of blank characters up to the last byte in the 
string'. The TRIM function will deal with this type of string.&lt;BR /&gt;&lt;BR /&gt;C-strings are terminated by one, but sometimes 2, null characters (CHAR(0)).&lt;BR /&gt;So the first occurrence of a null character in the string, searching from left to right, will be where the C-string is supposed to end - all characters after that may be rubbish.&lt;BR /&gt;If you have a C-string, and there is a run of one or more blank characters up to this first NULL character, and you want to terminate the string at the start of this run of blanks, you need to do a TRIM on the string that ignores the bytes from the first null character onwards, left to right.&lt;BR /&gt;&lt;BR /&gt;so&lt;BR /&gt;&lt;BR /&gt;stringshort = TRIM( cstring( 1:INDEX( cstring,CHAR(0) )-1 ) )&lt;BR /&gt;&lt;BR /&gt;If you decide that the strings that you are interested in are 'terminated' with a particular character CHAR(N), then just substitute CHAR(n) in the above.&lt;BR /&gt;</description>
    <pubDate>Fri, 18 Feb 2011 10:47:31 GMT</pubDate>
    <dc:creator>anthonyrichards</dc:creator>
    <dc:date>2011-02-18T10:47:31Z</dc:date>
    <item>
      <title>remove space from string</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799573#M37058</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I am using Intel Fortran 2011to get a folder path, I got a problem when usedAPI function &lt;STRONG&gt;SHGetFolderPath.&lt;/STRONG&gt; The problem is that I got a string like "C:\\....\\My Documents , I want to use trim() function to remove the space but failed, it seemed not space. could you help to solve the problem?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Kafty</description>
      <pubDate>Thu, 17 Feb 2011 11:07:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799573#M37058</guid>
      <dc:creator>chen__kafty</dc:creator>
      <dc:date>2011-02-17T11:07:55Z</dc:date>
    </item>
    <item>
      <title>remove space from string</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799574#M37059</link>
      <description>&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;I think that the &lt;B&gt;SHGetFolderPath &lt;/B&gt;returns a C string (i.e. with a null character at the end), The best way to find where the string terminates is to use the index() function like in the sample code below:&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;length = index(Document, char(0)) - 1&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;and instead of using the trim() function, you can retrieve the substring by:&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;Document(1:length)&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;Phil&lt;/DIV&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Feb 2011 12:36:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799574#M37059</guid>
      <dc:creator>netphilou31</dc:creator>
      <dc:date>2011-02-17T12:36:38Z</dc:date>
    </item>
    <item>
      <title>remove space from string</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799575#M37060</link>
      <description>Kafty,&lt;BR /&gt;TRIM removes &lt;EM&gt;&lt;STRONG&gt;trailing&lt;/STRONG&gt;&lt;/EM&gt;spaces not embeded spaces like in"My Documents". &lt;BR /&gt;If you wish to remove embedded spaces then you must write a routine to do it BUT of course the result won't be the actual path.&lt;BR /&gt;For example you could use "index" and loop to find each space and adjust the string to remove it or replace the space with something else (e.g. underscore)&lt;BR /&gt;&lt;BR /&gt;Les</description>
      <pubDate>Thu, 17 Feb 2011 13:01:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799575#M37060</guid>
      <dc:creator>Les_Neilson</dc:creator>
      <dc:date>2011-02-17T13:01:02Z</dc:date>
    </item>
    <item>
      <title>remove space from string</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799576#M37061</link>
      <description>Kathy, is the problem that when you use the path in a generated command line that it gets treated as two or more arguments? The way to deal with this is to enclose the path in "".</description>
      <pubDate>Thu, 17 Feb 2011 15:21:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799576#M37061</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-02-17T15:21:21Z</dc:date>
    </item>
    <item>
      <title>remove space from string</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799577#M37062</link>
      <description>Les,&lt;BR /&gt;&lt;BR /&gt;Thanks, I only want to remove tailing spaces. what I guess that is not space but string characterin behind of the string. so the Trim function does not work&lt;BR /&gt;&lt;BR /&gt;Kafty</description>
      <pubDate>Fri, 18 Feb 2011 09:40:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799577#M37062</guid>
      <dc:creator>chen__kafty</dc:creator>
      <dc:date>2011-02-18T09:40:56Z</dc:date>
    </item>
    <item>
      <title>remove space from string</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799578#M37063</link>
      <description>Kafty,&lt;BR /&gt;&lt;BR /&gt;I have experienced the same strange behavior with API functions that returns a NULL terminated string. In this case it seems that the trim() function does not work properly and that the only way to get the correct lenght is to find the NULL character in the string (by using the index() function) as mentioned in my previous reply.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Phil.</description>
      <pubDate>Fri, 18 Feb 2011 10:05:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799578#M37063</guid>
      <dc:creator>netphilou31</dc:creator>
      <dc:date>2011-02-18T10:05:54Z</dc:date>
    </item>
    <item>
      <title>remove space from string</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799579#M37064</link>
      <description>To truncate the string, deleting everything from the first blank onwards (when searching from left to right in the string):&lt;BR /&gt;&lt;BR /&gt;stringshort=stringlong(1:INDEX(stringlong,' ')-1)</description>
      <pubDate>Fri, 18 Feb 2011 10:13:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799579#M37064</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2011-02-18T10:13:52Z</dc:date>
    </item>
    <item>
      <title>remove space from string</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799580#M37065</link>
      <description>This works only if the string does not contains any blank inside !</description>
      <pubDate>Fri, 18 Feb 2011 10:27:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799580#M37065</guid>
      <dc:creator>netphilou31</dc:creator>
      <dc:date>2011-02-18T10:27:05Z</dc:date>
    </item>
    <item>
      <title>remove space from string</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799581#M37066</link>
      <description>First define what you mean by 'the end of the string'.&lt;BR /&gt;&lt;BR /&gt;Fortran strings may be defined as ending 'at the character before a 
continuous run of blank characters up to the last byte in the 
string'. The TRIM function will deal with this type of string.&lt;BR /&gt;&lt;BR /&gt;C-strings are terminated by one, but sometimes 2, null characters (CHAR(0)).&lt;BR /&gt;So the first occurrence of a null character in the string, searching from left to right, will be where the C-string is supposed to end - all characters after that may be rubbish.&lt;BR /&gt;If you have a C-string, and there is a run of one or more blank characters up to this first NULL character, and you want to terminate the string at the start of this run of blanks, you need to do a TRIM on the string that ignores the bytes from the first null character onwards, left to right.&lt;BR /&gt;&lt;BR /&gt;so&lt;BR /&gt;&lt;BR /&gt;stringshort = TRIM( cstring( 1:INDEX( cstring,CHAR(0) )-1 ) )&lt;BR /&gt;&lt;BR /&gt;If you decide that the strings that you are interested in are 'terminated' with a particular character CHAR(N), then just substitute CHAR(n) in the above.&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Feb 2011 10:47:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799581#M37066</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2011-02-18T10:47:31Z</dc:date>
    </item>
    <item>
      <title>remove space from string</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799582#M37067</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;Thanks for all of your help. Phil's solution can help me to solve the problem.&lt;BR /&gt;&lt;BR /&gt;Thanks a lot.&lt;BR /&gt;Kafty&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2011 02:19:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/remove-space-from-string/m-p/799582#M37067</guid>
      <dc:creator>chen__kafty</dc:creator>
      <dc:date>2011-02-22T02:19:48Z</dc:date>
    </item>
  </channel>
</rss>

