i am using the following code :
importTabs.Add(row["TABLE_NAME"].ToString().TrimEnd('$')
to remove a dollar from string stored in importTabs Array list. how do i pass a parameter along with '$' so that it removes a single quote (') from the beginning ans well the end of the string?
You could use another trim:
importTabs.Add(row["TABLE_NAME"].ToString().Trim('\'').TrimEnd('$')
Or, if you don't mind removing the $
at the beginning too, you can do it all at once:
importTabs.Add(row["TABLE_NAME"].ToString().Trim('\'', '$')
That saves you from creating one more string instance than you need to.
I would use trim twice
importTabs.Add(row["TABLE_NAME"].ToString().Trim('\'').TrimEnd('$')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With