Free cookie consent management tool by TermsFeed Policy Generator

source: stable/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/SqRefUtility.cs @ 12440

Last change on this file since 12440 was 9580, checked in by sforsten, 12 years ago

#1730:

  • added SymbolicDataAnalysisExpressionExcelFormatter
  • changed modifiers in SymbolicExpressionTreeChart of methods SaveImageAsBitmap and SaveImageAsEmf to public
  • added menu item ExportSymbolicSolutionToExcelMenuItem to export a symbolic solution to an excel file
  • added EPPlus-3.1.3 to ExtLibs
File size: 1.3 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Text.RegularExpressions;
6
7namespace OfficeOpenXml.Utils
8{
9    /// <summary>
10    /// Class for handling translation between ExcelAddresses and sqref addresses.
11    /// </summary>
12    public static class SqRefUtility
13    {
14       /// <summary>
15       /// Transforms an address to a valid sqRef address.
16       /// </summary>
17       /// <param name="address">The address to transform</param>
18       /// <returns>A valid SqRef address</returns>
19       public static string ToSqRefAddress(string address)
20       {
21           Require.Argument(address).IsNotNullOrEmpty(address);
22           address = address.Replace(",", " ");
23           address = new Regex("[ ]+").Replace(address, " ");
24           return address;
25       }
26
27       /// <summary>
28       /// Transforms an sqRef address into a excel address
29       /// </summary>
30       /// <param name="address">The address to transform</param>
31       /// <returns>A valid excel address</returns>
32       public static string FromSqRefAddress(string address)
33       {
34           Require.Argument(address).IsNotNullOrEmpty(address);
35           address = address.Replace(" ", ",");
36           return address;
37       }
38    }
39}
Note: See TracBrowser for help on using the repository browser.