octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #44641] strsplit fails to split with a delimit


From: anonymous
Subject: [Octave-bug-tracker] [bug #44641] strsplit fails to split with a delimiter of '<' or '>'
Date: Fri, 27 Mar 2015 03:28:27 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?44641>

                 Summary: strsplit fails to split with a delimiter of '<' or
'>'
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Fri 27 Mar 2015 03:28:26 AM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Richard Lobb
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.8.1
        Operating System: GNU/Linux

    _______________________________________________________

Details:

strsplit cannot split a string using a separator of '<' or '>'.

Here's the console output from a simple failing test:


octave:1> strsplit('xxx<yyy', '<')
ans = 
{
  [1,1] = xxx<yyy
}
octave:2> 


Compare that with the output with Octave, V3.6.4, which produces the correct
output:


octave:1> strsplit('xxx<yyy', '<')
ans = 
{
  [1,1] = xxx
  [1,2] = yyy
}
octave:2> 


or using Matlab R2013b and R2014b:


>> strsplit('xxx<yyy', '<')

ans = 

    'xxx'    'yyy'

>>


'>' also fails but all other separators (at least those with ordinal values
between 32 and 126 inclusive) are fine. The output from the following script:


for i = 32 : 126
    sep = char(i);
    line = ['xxx' sep 'yyy'];
    if sep == 'x' || sep == 'y'
        continue
    end
    bits = strsplit(line, sep);
    if length(bits) ~= 2
       fprintf('Failed with sep of %c (%d)\n', sep, i);
    end
end


is


Failed with sep of < (60)
Failed with sep of > (62)







    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?44641>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]