RE : [scilab-Users] conversion of a character array to a String

Collewet Guylaine guylaine.collewet at cemagref.fr
Fri Jan 14 11:25:14 CET 2011


Thanks

I succeeded in building a string, however I still have a problem :

I have read a character array in a file using 

fd=mopen(nom,"rb");
tab=mget(fd,"c",number_of_characters);
mclose(fd);

in tab I get the ascii code of each character (eg : 99 for 'c')

I would like to search a substring  in tab
substring="string to search"

if I use tab_string=strcat(code2str(tab)) or tab_string=string(code2str(tab)) and then start=strindex(tab,substring); it does not work since code2str does not give the inverse of the ascii code

for example : 
ascii('c')=99
code2str(99)= !

What is the difference between the ascii code and the "scilab" code ?

Guylaine



-------- Message d'origine--------
De: Rakhi Warrier [mailto:rakhiwarriar at yahoo.co.in]
Date: ven. 14/01/2011 10:22
À: users at lists.scilab.org
Objet : Re: [scilab-Users] conversion of a character array to a String
 
Will this help?
string()
ascii()

Regards
Rakhi

--- On Fri, 14/1/11, Collewet Guylaine <guylaine.collewet at cemagref.fr> wrote:

From: Collewet Guylaine <guylaine.collewet at cemagref.fr>
Subject: [scilab-Users] conversion of a character array to a String
To: users at lists.scilab.org
Date: Friday, 14 January, 2011, 1:23 PM

Hello,

How can I convert a character array to a String with scilab ?

thank you

Guylaine Collewet



-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 3232 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20110114/a9d9a3c0/attachment.bin>


More information about the users mailing list