Download
100% FREE
Office Document APIs for .NET
Online: 700
Home
Articles
Interviews
Forums
For Beginners
Popular Questions
ITIL Career Advice
PMP Career Advice
Career Advices
Codes
Videos
ASP.NET
ASP.NET MVC
Android Intel XDK
Sql Server
AngularJS
Bootstrap
Backbone.JS
MongoDB
LESS (CSS)
jQuery
WPF
WWF
SSIS
LightSwitch
Tutorials
News
ASP.NET MVC
|
Be Interview Ready
|
Top Performers
|
DNF MVP
|
Top Posts
|
Winners
|
Subscribe
|
Catalogs
Welcome Guest !
Register
Login
Home
>
Forums
>
Windows Forms
>
Loading ...
Increment value of an string [Resolved]
Posted by
Sudhakar_A
under
Windows Forms
on 9/5/2013 |
Points: 10
| Views : 1632 | Status :
[Member]
| Replies : 2
Write New Post
|
Search Forums
|
Resolved Posts
|
Un Answered Posts
|
Forums Home
string sequenceno="0003";
I wan to increment value of the string by 1 wen a for loop run i.e string sequenceno should be "0004"- in 1st loop & "0005" in 2nd loop and soon.
Please help me sort out.
Thnk's in advance
[Resolved]
Reply
|
Reply with Attachment
Alert Moderator
Responses
Posted by:
Allemahesh
on: 9/5/2013
[Member]
[MVP]
Silver
|
Points: 50
0
You can use the below method.
Here you need to set the i max value.
In my below example, I have set 50.
string sequenceno="0003";
for(int i=0; i<50; i++)
{
sequenceno = convert.ToString(Convert.toInt32(sequenceno) + 1);
}
Happy coding.
Sudhakar_A
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Allemahesh
on: 9/5/2013
[Member]
[MVP]
Silver
|
Points: 50
0
You can use the below code as well.
int a = 50;
string sequenceno="0003";
for(int i=0; i<a; i++)
{
sequenceno = convert.ToString(Convert.toInt32(sequenceno) + 1);
//Do you process.
}
Happy coding.
Sudhakar_A
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Login to post response
Latest Posts
Get all materials of parent and its children in an array except for few
(0)
New
Container in Media Query
(0)
How to send keys to specified app with title?
(1)
NullReferenceException when adding list
(0)
How to run a VB.NET exe in the backend on Azure VM server?
(0)
Null Reference Exception
(0)
How do you parse the Subject Alternate Names from an X509Certificate2?
(0)
Framework64\v4.0.30319\Config\web.config file is not well formed
(0)
More ...