Link to home
Start Free TrialLog in
Avatar of Philippe Renaud
Philippe RenaudFlag for Canada

asked on

Help manipulating my String

Hello EE,

I have a string like this:

"=SUM(B1+C1+D1)"

What I need to do is each digit I need to increase by 1

so the string need to be at the end:

"=SUM(B2+C2+D2)"

another example:
"=SUM(B4+D5+H11)"

needed result:  "=SUM(B5+D6+H12)"

any idea ? (how to repert the digit then +1 on it etc..)
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I would handle this by keeping the rows seperate:

int b=5;
int d=6;
int h=11;
String result;

result = print(b,d,h);

b++;
d++;
h++;

result = print(b,d,h);


string print(int b, int d, int h)
{
  return String.Format("=Sum(B{0}+D{1}+H{2}",b,d,h)
}
Avatar of Philippe Renaud

ASKER

Hey kaufmed, related question :  


https://www.experts-exchange.com/questions/27655660/Help-manipulating-my-String.html


how could we do both at the same time?  do you think its possible via the same Delegate maybe?
by the way I clicked the wrong accepted answer. damn Im sorry, how can we fix this?
I went too fast
You can click "Request Attention", but I'm not stressed about it. It's up to you  = )
Yea i did it :)
thanks