'How can I "replace" a letter in uppercase only in excel vb.net [closed]
I am writing a script in vb.net and wanted to replace the "N" letter, how can I do it? It also deletes the letter in the word "online"
thank you.
ws1.Range("F:F").Replace(("N"), "")
does also remove the N in "Online" which is the header of column F
Solution 1:[1]
You can use the String.Replace() method.
This works:
Dim strOldString As String = "Never replace the lowercase n in online"
Dim strNewString As String = strOldString.Replace("N", "0")
Debug.WriteLine(strNewString)
Output:
0ever replace the lowercase n in online
Here is the Microsoft documentation for the String.Replace() method
If this solves your question, please mark this as your accepted answer.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
