CodeBase.Replace忽略大小写

编程入门 行业动态 更新时间:2024-10-09 09:22:40
本文介绍了CodeBase.Replace忽略大小写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有以下代码: assembly.CodeBase.Replace(assembly.ManifestModule.Name,") 替换区分大小写.

I have the following code: assembly.CodeBase.Replace(assembly.ManifestModule.Name, "") Replace is case sensitive. Is there an alternative to make it ignore case?

推荐答案

请参阅我对问题的评论. 因此,我不完全理解为什么要做这种奇怪的事情.甚至更少的您为什么要以不区分大小写的方式进行操作.我认为这没有任何意义.基于我的猜测,请考虑一下: Please see my comment to the question. So, I don''t fully understand why doing such weird thing; and even less why would you want to do it in a case-insensitive way. I don''t think it makes any sense. As a hint based on my guesswork, think about this: Assembly someAssembly = //... string executableModuleName = assembly.Location; string executablePath = System.IO.Path.GetDirectoryName(executableModuleName);

怎么样?

—SA

How about it?

—SA

您可以使用正则表达式替换: You can use the Regex replace: Regex.Replace(string, string, string, RegexOptions.IgnoreCase);

更多推荐

CodeBase.Replace忽略大小写

本文发布于:2023-11-11 08:28:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1577885.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:大小写   CodeBase   Replace

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!