Line | |
---|
1 | using OfficeOpenXml.FormulaParsing.ExpressionGraph;
|
---|
2 | using System;
|
---|
3 | using System.Collections.Generic;
|
---|
4 | using System.Linq;
|
---|
5 | using System.Text;
|
---|
6 |
|
---|
7 | namespace OfficeOpenXml.FormulaParsing.Excel.Functions.Text
|
---|
8 | {
|
---|
9 | public class CharFunction : ExcelFunction
|
---|
10 | {
|
---|
11 | public override CompileResult Execute(IEnumerable<FunctionArgument> arguments, ParsingContext context)
|
---|
12 | {
|
---|
13 | ValidateArguments(arguments, 1);
|
---|
14 | var number = ArgToInt(arguments, 0);
|
---|
15 | ThrowExcelErrorValueExceptionIf(() => number < 1 || number > 255, eErrorType.Value);
|
---|
16 | return CreateResult(((char) number).ToString(), DataType.String);
|
---|
17 | }
|
---|
18 | }
|
---|
19 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.