How to test if a given string contains a valid number?



How to test if a given string contains a valid number?..

Answer / Ashish Singh

To test if a given string contains a valid number in Delphi, you can use the TryStrToType function. Here's an example:

```delphi
function IsValidNumber(const S: String): Boolean;
begin
Result := TryStrToType<Double>(S, 0);
end;
```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Delphi Interview Questions

Why is there no automation in releasing the memory automatically during the termination of the program?

1 Answers  


How to Determine if Delphi Running?

1 Answers  


How to Change the main form of an application at runtime ?

1 Answers  


How to Get current record from a TDBGrid ?

1 Answers  


How to Add a document to the Windows 95 Start Button's documents ?

1 Answers  


What technical support do we get with Delphi?

1 Answers  


what are Hetergenious joins ?

1 Answers  


How to convert numbers into roman numerals?

1 Answers   Intel,


How to Copy contents of a control to the clipboard?

1 Answers  


How to Create resource files?

0 Answers  


How to run executables created in Kylix?

1 Answers  


How to get the date of the last day in the current month?

1 Answers  


Categories