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
Anand KellyAnand Kelly 

Salesforce developer console

Hai All,I  am new to salesforce how to add 3,6,9,12 before text  i need output like that 3 Anand,6 Anand
V V Satyanarayana MaddipatiV V Satyanarayana Maddipati
Hi Anand,

Append the value to the string as shown below .
Here you find the code :
string str = 'Anand';
string s1 = '3 '+ str+',6 '+str+',9 '+str+',12 '+str;
system.debug(s1);
Extentia ITExtentia IT
Hi Anand,

Here is a more dynamic and configurable code snippet:

string str = 'Anand', output='';
Integer startNumber = 1, multiplier = 3, range = 10;

for(Integer index=1; index <= range; index++)
{
output += (startNumber*index*multiplier) + ' '+str+',';
}

System.debug(output);