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

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
iAm_ManCat
Super User
Super User

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
iAm_ManCat
Super User
Super User

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,708)