Rev | Line | |
---|
[12074] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Text;
|
---|
| 5 | using System.Text.RegularExpressions;
|
---|
| 6 |
|
---|
| 7 | namespace 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.