cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HarjitSamra
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
iAm_ManCat
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
iAm_ManCat
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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (37,141)