I have a string which is like this ..String s=and oc='LOCAL' and oc='STD' and oc='ISD' and oc='INC'
.Now as per my requirement if this string contains more than one and
then i have to replace all other and
with or
except first and
else it should be the same string only..
Please help me how to get to know about more than one and
and how to replace all other and
except first one.
I am trying to get this using replace
but i am not getting it exactly..
Please help me..
Doesn't sound like you've put much effort in, but here are 2 options:
string.IndexOf
to get the index of your first and
, and from there, cut the rest, and then use string.Replace
to change and
to or
and
s that aren't the first to or
.이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다