Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Convert char to string

0 Likes
12,966

Hi,

How do I convert from char to string? Is it possible?

Thanks & Regards,

Lohit

1 ACCEPTED SOLUTION
Read only

valter_oliveira
Active Contributor
0 Likes
4,665

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.

5 REPLIES 5
Read only

valter_oliveira
Active Contributor
0 Likes
4,666

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.

Read only

Former Member
0 Likes
4,665

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

Read only

Former Member
0 Likes
4,665

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.

Read only

Former Member
0 Likes
4,665

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

Read only

Former Member
4,665

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