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

  • Home
  • SEARCH
  • 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 3315520
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:21:36+00:00 2026-05-17T22:21:36+00:00

Is there any way to detect the type from a given string input? Eg:

  • 0

Is there any way to detect the type from a given string input?

Eg:

string input = "07/12/1999";

string DetectType( s ) { .... }

Type t = DetectType(input); // which would return me the matched datatype. i.e. "DateTime" in this case.

Would I have to write this from scratch?
Just wanted to check if anybody knows of a better way before I went about it.

Thanks!

  • 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-17T22:21:36+00:00Added an answer on May 17, 2026 at 10:21 pm

    I’m pretty sure you’ll have to write this from scratch – partly because it’s going to be very strictly tailored to your requirements. Even a simple question such as whether the date you’ve given is December 7th or July 12th can make a big difference here… and whether your date formats are strict, what number formats you need to support etc.

    I don’t think I’ve ever come across anything similar – and to be honest, this sort of guesswork usually makes me nervous. It can be hard to get parsing right even when you know the data type, let alone when you’re guessing at the data type to start with 🙁

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

Sidebar

Related Questions

Is there any way to cascade UIGestureRecognizers to detect a tap and then drag.
I'm trying to find a good way to detect when the window's name has
I am working on a video site that has different movies and videos which
I used System.Windows.Window.IsActive to detect whether the window is in the foreground and it
how can I detect whether I'm using iphone simulator or ipad simulator. I'm using
I have a FlowLayoutPanel with AutoScroll = true I need to detect the movement
I have an alarm clock app which works on a timer. When the alarm
I'm writing an assembly program that calculates Fibonacci numbers, but I need to find
I have some critical logic in a finally block (with an empty try block),
Ok, I'm building a horizontal scroll website for a photographer. We have some really

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.