[SV LRM 2017] Finding unique strings which are in lowercase

SA = {"Bob","Henry","Apply","abc","fdg","abc","dsf","ghu","jko","A"}; 
qs = SA.unique( s ) with ( s.tolower );
$display("%p",qs);

for above code , I am getting values as below:
'{“A”, “abc”, “Apply”, “Bob”, “dsf”, “fdg”, “ghu”, “Henry”, “jko”}

It is not as per expected because it also involves strings which are in uppercase.What can be possible cause?

In reply to juhi_p:

The unique() method does not modify any elements, it only removes duplicate elements based on the comparison criteria. A better description of this code would be a case-insensitive unique filter.

In reply to dave_59:

but what is s.tolower suppose to do here?

In reply to juhi_p:

In this example it doesn’t do anything. A better example would be:

SA = {"Bob","BOB","abc","abc","ABC","A"}; 
qs = SA.unique( s ) with ( s.tolower );

It does the comparison as if you had wrote:

{"bob","bob","abc","abc","abc","a"}

However, it only uses that to choose which elements from the original array to pick for the result. It sees 3 unique element sets: SA[0]/SA[1], SA[2]/SA[3]/SA[4], and SA[5]. So it can return any of these possibilities:

{SA[0], SA[2],SA[5]}
{SA[1], SA[2],SA[5]}
{SA[0], SA[3],SA[5]}

{SA[1], SA[4],SA[5]}