function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shaun Pemberton 4Shaun Pemberton 4 

how to separate a text field

Hey, i've asked salesforce support if this is possible and they tell me it's not however I find it hard to believe.

If you have 3 cells with the following content:
Cell 1 - (2 characters) example: 01
Cell 2 - (3 characters) example: 123
Cell 3 - (3 characters) example: 345

They can be combined into one as 01123345

I'm looking for a text field with 8 characters to be split into 3 cells using the same format as above;

For example: 01123345

Cell 1 - (2 characters) example: 01
Cell 2 - (3 characters) example: 123
Cell 3 - (3 characters) example: 345

Does anyone have any suggestions
 
Dushyant SonwarDushyant Sonwar
Hi Shaun ,

I am not sure whether i understood your problem. This is the answer from what i am assuming.

You want to split the text value to the cell. I have mentioned two ways using apex and visualforce , whichever you prefer will split the alphabet

Apex
 
if('01123345'.length() ==8){
System.debug('01123345'.mid(0 , 2));
System.debug('01123345'.mid(2 , 3));
System.debug('01123345'.mid(5 , 3));
}



Using VF Function
 
{!MID('01123345' ,  0 ,2)}
{!MID('01123345' ,  2 ,3)}
{!MID('01123345' ,  5 ,3)}