I got a list
List<String> paths = {"r", "e","t","t"};
and I want to add the data of paths into a CharSequence. I have done this code:
CharSequence[] cs = paths.toArray(new CharSequence[paths.size()]);
but I don’t know how to add the data in, please help, thanks
The problem is in constructing the list: you can’t use array syntax like that. You’ll have to add elements one by one —
and then you’ll be set.
If you can use third-party libraries like Guava, you could do