[c++/cli] how to put String^ into array<String^>^

hi everyone,
as in title...
Is there any possibility to put this:
String^ text
into this:
array<String^>^ tab
like e.g. string "c++" into tab[0]="c" tab[1]="+" tab[2]="+"

I know i can do that with char array, but i need to have it in String array...

thx in advance for any replies
JK
Last edited on
closed account (z05DSL3A)
Somthing like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "stdafx.h"

using namespace System;

int main(array<System::String ^> ^args)
{
    String^ text = gcnew String("Hello World");
    array<String^>^ tab = gcnew array<String^>(text->Length);

    for(int i =0; i < tab->Length; ++i)
    {
        tab[i] = text->Substring(i,1);

        Console::WriteLine(tab[i]);
    }

    return 0;
}

this is what i was looking for, kinda missing link, ok thx a lot Grey Wolf for your help
Topic archived. No new replies allowed.