1 # Created by Octave 3.6.1, Sat Mar 17 00:02:04 2012 UTC <root@t61>
13 # name: <cell-element>
17 -- Function File: RVAL = base64decode (CODE)
18 -- Function File: RVAL = base64decode (CODE, AS_STRING)
19 Convert a base64 CODE (a string of printable characters according
20 to RFC 2045) into the original ASCII data set of range 0-255. If
21 option AS_STRING is passed, the return value is converted into a
24 ##base64decode(base64encode('Hakuna Matata'),true)
25 base64decode('SGFrdW5hIE1hdGF0YQ==',true)
26 ##returns 'Hakuna Matata'
28 See: http://www.ietf.org/rfc/rfc2045.txt
30 See also: base64encode
36 # name: <cell-element>
40 Convert a base64 CODE (a string of printable characters according to
45 # name: <cell-element>
52 # name: <cell-element>
56 -- Function File: Y = base64encode (X)
57 -- Function File: Y = base64encode (X, DO_RESHAPE)
58 Convert X into string of printable characters according to RFC
59 2045. The input may be a string or a matrix of integers in the
60 range 0..255. If want the output in the 1-row of strings format,
61 pass the DO_RESHAPE argument as true.
64 base64encode('Hakuna Matata',true)
65 ##returns 'SGFrdW5hIE1hdGF0YQ=='
67 See also: base64decode
73 # name: <cell-element>
77 Convert X into string of printable characters according to RFC 2045.
81 # name: <cell-element>
88 # name: <cell-element>
92 -- Function File: RVAL = cstrcmp (S1, S2)
93 Compare strings S1 and S2 like the C function.
95 Aside the difference to the return values, this function API is
96 exactly the same as Octave's `strcmp' and will accept cell arrays
99 RVAL indicates the relationship between the strings:
100 * A value of 0 indicates that both strings are equal;
102 * A value of +1 indicates that the first character that does
103 not match has a greater value in S1 than in S2.
105 * A value of -1 indicates that the first character that does
106 not match has a match has a smaller value in S1 than in S2.
108 cstrcmp("marry","marry")
110 cstrcmp("marry","marri")
112 cstrcmp("marri","marry")
115 See also: strcmp, strcmpi
121 # name: <cell-element>
125 Compare strings S1 and S2 like the C function.
129 # name: <cell-element>
136 # name: <cell-element>
140 -- Function File: [DIST,L] = editdistance (STRING1, STRING2, WEIGHTS)
141 Compute the Levenshtein edit distance between the strings STRING1
142 and STRING2. This operation is symmetrical.
144 The optional argument WEIGHTS specifies weights for the deletion,
145 matched, and insertion operations; by default it is set to +1, 0,
146 +1 respectively, so that a least editdistance means a closer match
147 between the two strings. This function implements the Levenshtein
148 edit distance as presented in Wikipedia article, accessed Nov
149 2006. Also the levenshtein edit distance of a string with an empty
150 string is defined to be its length.
152 The default return value is DIST the edit distance, and the other
153 return value L is the distance matrix.
155 editdistance('marry','marie')
156 ##returns value +2 for the distance.
162 # name: <cell-element>
166 Compute the Levenshtein edit distance between the strings STRING1 and
171 # name: <cell-element>
178 # name: <cell-element>
182 -- Function File: RVAL = strjoin (PREFIXSTR, STRINGCELL)
183 -- Function File: RVAL = strjoin (PREFIXSTR, VARARGS)
184 Joins the strings in STRINGCELL with the PREFIXSTR like the
185 list-join function in Python; the second version allows usage with
186 variable number of arguments. Note that, if using cell-array as a
187 second argument, only 2 arguments are accepted. Also note that,
188 both the arguments are strings or containers of strings (cells).
190 strjoin(' loves-> ','marie','amy','beth')
191 ##returns 'marie loves-> amy loves-> beth'
193 strjoin('*',{'Octave','Scilab','Lush','Yorick'})
194 ##returns 'Octave*Scilab*Lush*Yorick'
202 # name: <cell-element>
206 Joins the strings in STRINGCELL with the PREFIXSTR like the list-join
211 # name: <cell-element>
218 # name: <cell-element>
222 -- Function File: [...] = strsort (...)
223 Overloads the sort function to operate on strings.
231 # name: <cell-element>
235 Overloads the sort function to operate on strings.