我想检查列表中的项目是否是有效的 Guid如果无效,则用 Guid 默认值替换字符串

问题描述

我得到一个包含 Guid 和字符串的值列表。但我只需要 Guids 并且必须用默认的 guid 值替换字符串值。你能建议怎么做吗?

var Value=abc.where(n=>n.userId).select(n=>n.userId);

谢谢

解决方法

我想您有一个 onAlive() 想要在 Guid 列表中进行转换。
如果是这种情况,答案很简单

BaseFragment

如果您不想要无效的 guid,那么

    private fun destroyThem(){
        
    }
    
    override fun onDestroy() {
        destroyThem() // it is ok to run
        super.onDestroy()
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        destroyThem() // do not allow them to run
        super.onCreate(savedInstanceState)
    }

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...