RE : [scilab-Users] conversion of a character array to a String
Collewet Guylaine
guylaine.collewet at cemagref.fr
Fri Jan 14 14:02:24 CET 2011
Hi,
I've found out that the function "ascii" converts in both "direction", that solves my problem
ascii('c')=99
ascii(99)='c'
regards
Guylaine
-------- Message d'origine--------
De: Collewet Guylaine [mailto:guylaine.collewet at cemagref.fr]
Date: ven. 14/01/2011 11:25
À: users at lists.scilab.org
Objet : RE : [scilab-Users] conversion of a character array to a String
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: 3476 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20110114/2dd0a80f/attachment.bin>
More information about the users
mailing list