‎2008 Mar 26 5:56 PM
Hi,
How do I convert from char to string? Is it possible?
Thanks & Regards,
Lohit
‎2008 Mar 26 5:59 PM
Hello Lohit.
What do you mean by converting from char to string? I don't know if i understood you right.
Simply assign the char variable to a string variable ... doing the oposite you may have problems ...
Best regards.
Valter Oliveira.
‎2008 Mar 26 5:59 PM
Hello Lohit.
What do you mean by converting from char to string? I don't know if i understood you right.
Simply assign the char variable to a string variable ... doing the oposite you may have problems ...
Best regards.
Valter Oliveira.
‎2008 Mar 26 6:03 PM
hi ,
you can use the concatenate statement ...
data: a value 'a',
b value 'b',
c value 'c',
d value 'd',
string type string.
concatenate a b c d into string .
write:/ string.
regads,
venkat.
Edited by: venkat appikonda on Mar 26, 2008 7:05 PM
‎2008 Mar 26 6:36 PM
I'm not sure, but I don't think you really need to convert those values, as you can simply atribute a char's value to a string.
However, if you try to do the inverse condition maybe it'll cut your string off, depending on the char's length.
‎2008 Mar 26 6:38 PM
hi,
use this
data: a(3) type c value 'kan',
str type string.
str = a.
or u can concatinate .
if any problem ask me.
regards,
chandu
‎2008 Mar 26 7:35 PM
Hi ,
In general STRING is a character array but the main difference between the character array and the string is that string has dynamic length while character array has static length.
i.e. suppose
data variable(10) type c,
variable1 type string.
Here variable is supposed to have a max length of 10 whereas variable1 can have any length (depends on the machine) .
So we can directly assign character varible to string and there is no need of the functional modules.
i.e variable1 = variable.
Incase if you want to merge more than one char variables into string , you can use 'CONCATENATE' for that. If you want to make string data into character varibles use 'SPLIT'.
Reward points if helpful.
Thanks and Regards.
Edited by: Ammavajjala Narayana on Mar 26, 2008 8:36 PM