+ Start a Discussion
d3developerd3developer 

Initializing List of Strings with Json-like Format

Okay folks, I know this is a n00b question but I can't remember if or how to initialize a string with a set of arguments.

 

What I want to do is something like this

 

 

List<String> alphabet = { 'a' , 'b' , 'c' ...  };

 

How can I do this?

 

Best Answer chosen by Admin (Salesforce Developers) 
Jeremy.NottinghJeremy.Nottingh

 

List<String> alphabet = new list<String> { 'a' , 'b' , 'c' ...  };

 That should do ya.

 

All Answers

Jeremy.NottinghJeremy.Nottingh

 

List<String> alphabet = new list<String> { 'a' , 'b' , 'c' ...  };

 That should do ya.

 

This was selected as the best answer
d3developerd3developer

Just what I was looking for. Thanks!

 

While we are at it, anyone have the code for including initialization and getter / setter fucntions?

 

Like:

 

public List<String> alpha { 'a', 'b' ... } {get; set;}

 

 

Harsh vardhana 10Harsh vardhana 10

List<String> alphanet = new list<String>('a ',' b',' c');

this would help u in apex;

Mohammed MohiddinMohammed Mohiddin
Try this 
 
List<String> alphabet {get;set;}

public constructor(){
 alphabet = new list<String> { 'a' , 'b' , 'c' ...  };
}

 
peter johneepeter johnee
The sun brought me away, I left pain. Missed hands together   cookie clicker (https://cookieclickers.co)
 
Michael Rodriguez 24Michael Rodriguez 24
Sdmoviespoint (https://lyricshunk.com/sdmoviespoint/) - There are many people around the world who like to watch movies and shows. Everybody has their own priorities according to which they choose to watch movies and different shows.
aliya buttaliya butt
Such a nice post by author for sharing valuable content with us. I am happy to share agile security usa here
https://agilesecurityusa.com/
Rahul Priya 3Rahul Priya 3
Sarkari Yojana (https://onlyhindigyan.com) </a> is the best website
Rahul Priya 3Rahul Priya 3
Berojgari Bhatta (https://onlyhindigyan.com/) is the best website
adam parker 36adam parker 36
HP Printer Setup is easy and here is the setup guide. Find the slot to fix the hardware. Select the appropriate network settings. If HP is your choice, wireless setup wizard is recommended. After connecting the printer to the network, find the software visiting the appropriate software download page. Now precede with the remaining setup steps. Get help and support to start HP Printer setup. Dial the support number and wait for the agents to contact @ +1-800-237-0201 (tel:+1-800-237-0201). Just visit our site 123.hp.com/setup (https://www.123hp-com.com/) for more details.
 
Why Pay FUllWhy Pay FUll
Hey founded a cool website:

Top 10 Best Split Ac in India (https://www.whypayfull.in/top-10-inverter-split-ac-in-india-2020/" target="_blank)
satyam Bishtsatyam Bisht
satyam Bishtsatyam Bisht
great work
<a href="https://hindustanpositive.com/misunderstanding-quotes-in-hindi/">misunderstanding quotes</a>
Rick Smith 47Rick Smith 47
Agreed with @Jeremy.Nottingh
he provided the exact answer. However, you can download LuluBox (https://lulubox.xyz) to unlock free fire and Mobile legends game free skin.
mark jones 123mark jones 123
It is my first visit to your blog, and I am very impressed with the articles that you serve. Give adequate knowledge for me. Thank you for sharing useful material. I will be back for the more great post. Today I found a great article on the internet Windows 7 pro product key list or if you using internet and you want some privacy and secrecy then you must try avast secureline vpn license key 2021 and we are providing it absolutely freely.
agensg sgpagensg sgp
Visit agensg (http://agensg.com/)for more details about this
kalu dakalu da
Thanks to the author for sharing valuable content with us https://bengalisms.com/bengali-birthday-wishes/
Priya Gupta 136Priya Gupta 136
For PM Modi Yojana (https://www.pmmodiyojana2020.com/) is best website 
shashi niralashashi nirala
List<String> alphanet = new list<String>('a ',' b',' c');
this would help u in apex;  Visit for latest yojana news PM KI YOJANA (https://pmkiyojana.com/) .
 
Priya Gupta 136Priya Gupta 136
List<String> alphanet = new list<String>('a ',' b',' c');
this would help u in apex;  Visit for latest yojana news PM Modi Yojana (https://www.pmmodiyojana2020.com/) (https://pmmodiyojana2020.com/) .
 
Divyesh BorisagarDivyesh Borisagar
Visit Digital Divyesh (https://digitaldivyesh.com" target="_blank) for more updates 
Why Pay Full WPFWhy Pay Full WPF
What happens when Google is Down for 1 Minute?

https://www.whypayfull.in/what-happens-when-google-is-down-for-1-minute/


<a href="https://www.whypayfull.in/what-happens-when-google-is-down-for-1-minute/">What happens when Google is Down for 1 Minute?</a>
mike smith 82103mike smith 82103
The Epson EcoTank Expression ET-3600 prints using inkjet technology, which sprays liquid ink onto the paper from a moving head. It prints text very well, nearly as good as a laser printer. Text printing was very quick, 11.5 pages per minute, costing 0.2 cents per page.

Setup Epson EcoTank ET-3600 Printer (http://https://1callassistant.com/connect-epson-ecotank-et-3600-printer-to-wifi/)
Rashid MinhasRashid Minhas
Really appreciated your solution that's what I was looking for.

Powered By :

https://trendingmafia.com/avast-secureline-vpn-license-2021/
Saddil AnsariSaddil Ansari
Awesome > I am from india visit my website  (https://sarkariyojanaup.com/janani-suraksha-yojana/) :- https://sarkariyojanaup.com/
PM Modi YojanaPM Modi Yojana
nice <a href="https://hindupedia.in/pm-kisan-samman-nidhi-yojana/">PM KISAN SAMMAN NIDHI YOJANA</a>
PM Modi YojanaPM Modi Yojana
List<String> alphanet = new list<String>('a ',' b',' c');
this would help u in apex;  Visit for latest yojana news PM Modi Yojana (https://hindupedia.in/pm-kisan-samman-nidhi-yojana/
https://hindupedia.in/
https://hindupedia.in/
PM Modi YojanaPM Modi Yojana
List<String> alphanet = new list<String>('a ',' b',' c');
this would help u in apex;  Visit for latest yojana news PM Modi Yojana
https://bit.ly/3qTaqCK

https://bit.ly/3uw2A4r

https://bit.ly/2O1RwLF
benito rrbenito rr
Check out some beautiful HP printer setup (https://Massprinters.com) models that you can utilize to print the best and quality documents by using HP printer wireless setup . For that, you should first configure the hardware and install the software on your computer system. Follow the prompts that are available on our site
shashi niralashashi nirala
Really appreciated your solution that's what I was looking for.Fun loby (https://www.funloby.com/).
supriyo khansupriyo khan
do you want to wish someone for his birthday? here is best birthday wishes in hindi (https://lovsms.com/happy-birthday-wishes-in-hindi)
PM Modi YojanaPM Modi Yojana
NSP (#

NSP (#

Nsp

Nsp
arafat Rahman 3arafat Rahman 3
Looks engaging and admirable :-) sad status bangla (https://riyadly.com/sad-status-bangla/)
Prosanta MondalProsanta Mondal
Thanks for Sharing This Valuable Content With Us Best Regards. Bangla Love Story (https://www.banglalovestory.in) | Gk Today (https://www.gk-today.in) | Bengali Jokes (https://www.banglalovestory.in/2020/04/jokes-in-bengali-2020.html)
Tech HypesTech Hypes
If someone week i really ashen-haired not actually pretty, whether you will lite grope a present, 
thought to follow us to displays bursting with ends of the earth considerably? Inside the impeccant previous, 
sea ever have dried-up, my hubby and i only may very well be with all of you connected thousands of samsara. Social Media Marketing (https://www.techhypes.com/)
jicejit jicejitlowimjicejit jicejitlowim
avast secureline vpn license key (https://plugcyber.com/avast-secureline-vpn-license-key/" target="_blank) - 
Avast Secureline VPN License Key for 2021 [Free]
kadir laskarkadir laskar
Very helpfull articles.
thanks to admin for post this type topic
Bengali Shayari
Bangla Shayari
https://bengalishayari.in/bengali-shayari-collection/
kadir laskarkadir laskar
<a href=''https://bengalishayari.in/bengali-shayari-collection/">Bengali Shayari</a>

<a href=''https://bengalishayari.in/birthday-wish-sms/"> Birthday Wish SMS </a>

<a href=''https://bengalishayari.in/good-night-bengali-sms/">Good Night Bengali SMS</a>

<a href=''https://bengalishayari.in/whatsapp-status-collection-in-bengali-2021/"> whatsapp status in bengali </a>

<a href=''https://bengalishayari.in/gopal-bhar-golpo/">Gopal Bhar Golpo</a>

<a href=''https://bengalishayari.in/bengali-love-sms/"> Bengali Love SMS </a>