How to sort an array of structs in ColdFusion

后端 未结 10 1771
余生分开走
余生分开走 2020-12-17 10:00

I have an array of structs in ColdFusion. I\'d like to sort this array based on one of the attributes in the structs. How can I achieve this? I\'ve found the StructSort fun

10条回答
  •  生来不讨喜
    2020-12-17 10:15

    Here's a UDF based on Tomalak's answer that also supports custom objects (e.g., used by some Railo-based CMSs). This function is compatible with ColdFusion 9.

    
      
      
      
      
      
      
      
      
        
        
          
        
        
        
          
        
      
        
        
          
          
        
        
        
          
        
      
      
    
    

提交回复
热议问题