Difference between revisions of "ListKeyCase"

From Second Life Wiki
Jump to navigation Jump to search
m (Redirected page to User:Ugleh Ulrik/ListKeyCase)
 
Line 1: Line 1:
{{LSL_Function
#redirect [[User:Ugleh_Ulrik/ListKeyCase]]
|func=ListKeyCase
|mode=user
|p1_type=list|p1_name=src|p1_desc=List to change case
|p2_type=integer|p2_name=case|p2_desc=1 is Upper, 0 is Lower.
|return_type=list
|return_text=that is a copy of '''src''' with all lower-case letters or all upper-case letters.
|func_footnote=
See also: [[List|Lists]]
|spec=<lsl>list ListKeyCase(list src,integer case){
list new;
integer b = llGetListLength(src);
integer i;
if (case){
    do
    new += [llToUpper(llList2String(src,i))];
    while (b>++i);
    return new;
}else{
    do
    new += [llToLower(llList2String(src,i))];
    while (b>++i);
    return new;
}
}
</lsl>
|caveats
|examples=<lsl>
list test = ["Apples","Bananas","Cranberrys","Donuts"];
list newtest = ListKeyCase(test,0);
//newtest now is ["apples","bananas","cranberrys","donuts"]</lsl>
|helpers
|notes
|also
|also_functions
|also_articles
|cat1=Examples
|cat2
|cat3
|cat4
}}

Latest revision as of 22:25, 7 May 2010