Table of Contents

XlsFile.ConvertString Method

Converts a string into the best datatype (a boolean, a number, etc)

Remarks

See ExcelFile.SetCellFromString(Int32, Int32, TRichString, Int32) for more information.

Syntax

Namespace: FlexCel.XlsAdapter

public override Object ConvertString(TRichString value, ref Int32 XF, String[] dateFormats)

Parameters

<-> Parameter Type Description
value TRichString RichString to convert.
ref XF Int32 XF of the cell. It might be modified, for example, if you are entering a date.
dateFormats String[] A list of formats allowed for dates and times. Windows is a little liberal in what it thinks can be a date, and it can convert things like "1.2" into dates. By setting this property, you can ensure the dates are only in the formats you expect. If you leave it null, we will trust "DateTime.TryParse" to guess the correct values.

Returns

value converted to the best datatype.

See also