Free cookie consent management tool by TermsFeed Policy Generator

source: branches/DataPreprocessing/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/AddressUtility.cs @ 10187

Last change on this file since 10187 was 9580, checked in by sforsten, 11 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: 1000 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Text.RegularExpressions;
6
7namespace OfficeOpenXml.Utils
8{
9    public static class AddressUtility
10    {
11        public static string ParseEntireColumnSelections(string address)
12        {
13            string parsedAddress = address;
14            var matches = Regex.Matches(address, "[A-Z]+:[A-Z]+");
15            foreach (Match match in matches)
16            {
17                AddRowNumbersToEntireColumnRange(ref parsedAddress, match.Value);
18            }
19            return parsedAddress;
20        }
21
22        private static void AddRowNumbersToEntireColumnRange(ref string address, string range)
23        {
24            var parsedRange = string.Format("{0}{1}", range, ExcelPackage.MaxRows);
25            var splitArr = parsedRange.Split(new char[] { ':' });
26            address = address.Replace(range, string.Format("{0}1:{1}", splitArr[0], splitArr[1]));
27        }
28    }
29}
Note: See TracBrowser for help on using the repository browser.