Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3306682
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:19:04+00:00 2026-05-17T21:19:04+00:00

I will have a number which was taken as input from the use or

  • 0

I will have a number which was taken as input from the use or i am storing a number assigned to a string as

  string s"1234567";

As for this the index of each string will be as 0,1,2,3,4 and so on

I would like to add the number with that index as 1+0, 2+1 , 3+2 and so on like that

so that the output should be 1,3,5 like that

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:19:04+00:00Added an answer on May 17, 2026 at 9:19 pm
    string s = string.Join(",", valueString.Select(
         (c, i) => (i + (int)(c-'0')) % 10));
    

    or in 2.0:

    string[] result = new string[valueString.Length];
    for(int i = 0; i < result.Length ; i++) result[i] =
             ((i + (int)(valueString[i] - '0')) % 10).ToString();
    string s = string.Join(",", result);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to develope a function which will take string (xml string) as input
I have a jqGrid with which users will select records. A large number of
I have this pattern: ~^([a-z0-9]+[a-z0-9-]+[a-z0-9]+\.([a-z]+)(\.[a-z]+)?)$~i It will match the following: xxx.xxx or xxx.xxx.xxx (number
I have five fields for number input, and each of these fields must be
I have a page called index.html which takes in a few variable from the
I have a table that potentially will have high number of inserts per second,
I have a number of questions users answer. An unanswered question will have a
I have a number of textboxes that will be displayed with their existing values.
I have a number of reports in a folder, and it will grow in
I have a perl script (or any executable) E which will take a file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.