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
EsteeEstee 

trimming a single space between words

I'm trying to make a unique Account Number.

I want to take the first 6 characters of the Account Name.

 

The Account Name is: HSBC Delaware

When i do: UPPER(TRIM(LEFT( Name, 6)))

I get: Account Number: HSBC D

I would like it to be: HSBCDE

 

Any ideas on how to remove all spaces from a text string including the single space between words??

Best Answer chosen by Admin (Salesforce Developers) 
RpeeRpee

UPPER( LEFT( SUBSTITUTE( Name , " " , "" ) , 6 ) )

All Answers

RpeeRpee

UPPER( LEFT( SUBSTITUTE( Name , " " , "" ) , 6 ) )

This was selected as the best answer
EsteeEstee
THANK YOU SO VERY MUCH! That worked perfectly!!