当前位置:网站首页>C# List字段排序含有数字和字符
C# List字段排序含有数字和字符
2022-04-23 04:45:00 【spring-java】
var temValue = 0;
var resultChar = result.Where(x => !int.TryParse(x.listcode.ToString().Replace(".", ""), out temValue)).OrderBy(y => y.listcode.ToString()).ToList();
result = result.Where(x => int.TryParse(x.listcode.ToString().Replace(".", ""), out temValue)).ToList().OrderBy(y => Convert.ToInt32(y.listcode.ToString().Replace(".", ""))).ToList();
result.AddRange(resultChar);
版权声明
本文为[spring-java]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_41463944/article/details/124326604
边栏推荐
- [paper reading] [3D object detection] voxel transformer for 3D object detection
- Spark FAQ sorting - must see before interview
- 那些年我面试过的Android开发岗总结(附面试题+答案解析)
- [timing] empirical evaluation of general convolution and cyclic networks for sequence modeling based on TCN
- 拼了!两所A级大学,六所B级大学,纷纷撤销软件工程硕士点!
- The programmer starts the required application with one click of window bat
- What is the thirty-six plan
- AWS eks add cluster user or Iam role
- List remove an element
- Eksctl deploying AWS eks
猜你喜欢
520. Detect capital letters
Installation and use of Apache bench (AB pressure test tool)
QML advanced (V) - realize all kinds of cool special effects through particle simulation system
Bridge between ischemic stroke and intestinal flora: short chain fatty acids
做数据可视化应该避免的8个误区
Experience summary and sharing of the first prize of 2021 National Mathematical Modeling Competition
Installation of zynq platform cross compiler
Spark optimization
基于英飞凌MCU GTM模块的无刷电机驱动方案开源啦
Introduction to raspberry pie 3B - system installation
随机推荐
Record the ThreadPoolExecutor main thread waiting for sub threads
leetcode006--查找字符串数组中的最长公共前缀
MySQL - data read / write separation, multi instance
Supplement 14: cmake practice project notes (to be continued 4 / 22)
No such file or directory problem while executing shell
Detailed explanation of life cycle component of jetpack
拼了!两所A级大学,六所B级大学,纷纷撤销软件工程硕士点!
Alibaba tip: it is better to create threads manually
Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.15.
leetcode001--返回和为target的数组元素的下标
QML进阶(五)-通过粒子模拟系统实现各种炫酷的特效
Unity camera rotation with sliding effect (rotation)
Spark small case - RDD, spark SQL
Basic operation of sequence table
Interaction of diet gut microbiota on cardiovascular disease
那些年我面试过的Android开发岗总结(附面试题+答案解析)
229. Find mode II
Case of using stream load to write data to Doris
Open the past and let's start over.
QML advanced (V) - realize all kinds of cool special effects through particle simulation system