How to increase number in string by 1 with C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        string str = "234";
        
        str = (Int32.Parse(str) + 1).ToString();

        Console.Write(str);
    }
}




/*
run:

235

*/

 



answered Aug 30, 2023 by avibootz

Related questions

1 answer 190 views
1 answer 184 views
1 answer 197 views
2 answers 309 views
309 views asked Jun 11, 2020 by avibootz
...