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
vasu takasivasu takasi 

how to pass values to a list<string> in test method

hi i have a code like list var=iphidden.split(':'); var.remove(0). while i am writing test method for this , it showing exception like System.NullPointerException: Attempt to de-reference a null object. How to solve it? Please help me.
Best Answer chosen by Admin (Salesforce Developers) 
sfdcfoxsfdcfox

I assume that you did not set iphidden before calling the function, thus it would be null and not have any functions to call, such as String.split(). make sure there is a value assigned before attempting to call instance methods.