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 8234355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:26:49+00:00 2026-06-07T18:26:49+00:00

I have to do following kind of conversions where my source string can have

  • 0

I have to do following kind of conversions where my source string can have one or two periods and where each number is represented by two digits. So a “1” becomes “01” and a “90” becomes “90”. Here’s an example of the before -> after

0.0 -> 0000
1.1 -> 0101
10.10 -> 1010
1.88 -> 0188
1.11.22 -> 011122
33.44.5 -> 334405

I have the following function but it does work for the different combinations. Can anyone suggest how I can make it work for the case where there are 1 or 2 periods in my input:

    public string DotFormatToRowKey(string tempRowKey) {
        return string.Join("", from s in id.Split('.')
                               select s.PadLeft(2, '0')).PadRight(4, '0'));
    }
  • 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-06-07T18:26:51+00:00Added an answer on June 7, 2026 at 6:26 pm

    This should work:

    public string DotFormatToRowKey(string tempRowKey) {
            var splits = tempRowKey.Split('.') // Split string at "."
                         .Select(x => String.Format("{0:d2}", Int32.Parse(x))) // Specify string format
                         .ToList();
            return String.Join(String.Empty, splits.ToArray()); // Join array and return
    }
    

    Reference: http://msdn.microsoft.com/en-us/library/dd260048.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code : System.out.println(new String(–’.getBytes(ISO8859_15_FDIS))); The two characters in the first
I have following kind of string /asdfd-dfsdf-sadfdfsdf-safdsfok-785452145x/dshfkjsd-sdfsd-sdfsdfsn-sfsdfe-jsdfdss/9?sdf=sdfsdf32d-0sdf8d-49sfe-asdf7-4fsfs32dd73880 out of which i wan to extract
i have following kind of records in mongodb { user_id : 79102, country_code :
I would like to have the following kind of HTML: <header></header> <div id='main'></div> <footer></footer>
Let's say I have the following: Vegetable=Potato ( Kind of vegetable that i have
I have a Spring Batch process which has following kind of code. <step id=step1
I have seen lot projects following this kind of coding style Any significant advantage
So I have the following: A UITableView with deletable cells (the kind where you
What kind of strategy do I have for the following problem. I want to
I have following source. In insertMessage(..), it calls selectMessage to check whether duplicate record

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.