How can I convert a string to a character vector?

I would like to convert a string into a character vector. How can I do this in GAUSS?

1 Answer



0



accepted

The type of the output follows the first element when using the string addition operator ($+) in GAUSS. Therefore you can use this operator to convert a string to a character vector like this:

myString = "GDP";
myCharVec = 0$+myString;

Now myCharVec will be a character vector which you can print using the ($) operator like so:

print $myCharVec;

which will return:

   GDP

aptech

1,773

Your Answer

1 Answer

0
accepted

The type of the output follows the first element when using the string addition operator ($+) in GAUSS. Therefore you can use this operator to convert a string to a character vector like this:

myString = "GDP";
myCharVec = 0$+myString;

Now myCharVec will be a character vector which you can print using the ($) operator like so:

print $myCharVec;

which will return:

   GDP

You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.