cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate I
Advocate I

Convert String characters to a collection

Hi,

 

I'm trying to take a string and add each of it's characters to a collection.  

 

So for string

TEST STRING

 

I would populate a collection with

Record 1 - T

Record 2 - E

Record 3 - S

etc.

 

Any ideas?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User II
Super User II

Hi!

 

Have you considered using the Split() function, this will split the text into single characters if you use the separator of "" rather than an actual text value.

ClearCollect(ThisCollection, Split(TextToSeparate, "") );

 

Could you give that a try and let me know if you run into any issues?

 

Thanks,

Sancho


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

3 REPLIES 3
Super User II
Super User II

Hi!

 

Have you considered using the Split() function, this will split the text into single characters if you use the separator of "" rather than an actual text value.

ClearCollect(ThisCollection, Split(TextToSeparate, "") );

 

Could you give that a try and let me know if you run into any issues?

 

Thanks,

Sancho


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

Thanks @iAm_ManCat  - works perfectly.  I never thought of using Split with an empty string - though I did see in the Microsoft help Docs for Split.. 🤔😁

Glad I could help, I've had to use it again recently so it was fresh in my mind 😺

Hope you have a great day!


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (4,243)