0

Here i have one string value 0515 and i want to display 1505 from frontend(C#).

Anyone have any idea ?

String Str1 = ds.table[0].rows[a][5];

From Str1 im getting 0515 but i want to display as 1505.

5
  • Is there any logic to this change? What have you tried? Where are you trying to display this? Commented Dec 19, 2012 at 5:44
  • so, you want to display last two characters at first place? Commented Dec 19, 2012 at 5:45
  • yes Usman. I need to display that in label Commented Dec 19, 2012 at 5:47
  • Yes ryadavilli. My client like to display like that Commented Dec 19, 2012 at 5:50
  • That (rearranging arbitrary characters) simply isn't something that string.Format offers Commented Dec 19, 2012 at 6:29

2 Answers 2

1
string temp = ds.table[0].rows[a][5];
string Str1 = temp.Substring(2) + temp.Substring(0, 2);
Sign up to request clarification or add additional context in comments.

1 Comment

+1 With the given requirements, this is perfect. What the hell the point is, is beyond me.
0

Another way to d this without using Concatenation string is as follow

string Str1 = string.Format("{0}{1}", s1.Substring(2), s1.Substring(0, 2));

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.