Hello friends,
I need to manipulate the "Contraente " column so that it eliminates the part of the string “ProprietarioCATTANEO MARIKA SONIA” because it contains a repatition of the first part. 20180709.xlsx (22.7 KB)
Assuming you only want to change that particular cell , you could do something like this(assuming str is holding the value at specified cell)
str = str.Remove(str.IndexOf(“Proprietario”))
If you are iterating through the whole DataTable you can check
if row(“Contraente”).ToString.Contains(“Proprietario”)
then row(“Contraente”)=row(“Contraente”).ToString.Remove(row(“Contraente”).ToString.IndexOf(“Proprietario”))
What i’m trying to do is that, I want to remove any characters after the space.
For example,
String id = “HDB000ETT18300105 / DPG-TN180009”
I want to remove anything that is beyond the space character
So my output must be id = “HDB000ETT18300105”
I tried using the method of id=id.Substring(0,strWord.IndexOf(" ")).Trim
but it did not work for me.
It needs to loop through all the rows to check and remove the unwanted characters.