We had a project where a list of strings needed to be sorted on with some keywords (if they appeared in the list) to come up first.
If they didn't appear then, no problem, the list should be returned entirely.
This seems like a job for a lambda function. There are some examples for e.g. length searching but no exact function.
This is what we found. Maybe it from javascript experience by we expected the function to return 0 or 1. Investigating and putting a break point on the 'c' variable below shows it is actually -1 and +1 that are returned and give the sort.
Kbytes Home | Privacy Policy | Contact us | Testing Area
© 2004 - 2024 1 Oak Hill Grove Surbiton Surrey KT6 6DS Phone: +44(020) 8123 1321