Replace
内容
[
隐藏
]Replace(string, string)
用新字符串替换单元格的值。
public int Replace(string placeHolder, string newValue)
范围 | 类型 | 描述 |
---|---|---|
placeHolder | String | 单元格占位符 |
newValue | String | 要替换的字符串值 |
例子
[C#]
Workbook workbook = new Workbook();
......
workbook.Replace("AnOldValue", "NewValue");
[Visual Basic]
Dim workbook As Workbook = New Workbook()
........
orkbook.Replace("AnOldValue", "NewValue")
也可以看看
- class Workbook
- 命名空间 Aspose.Cells
- 部件 Aspose.Cells
Replace(string, int)
用新整数替换单元格的值。
public int Replace(string placeHolder, int newValue)
范围 | 类型 | 描述 |
---|---|---|
placeHolder | String | 单元格占位符 |
newValue | Int32 | 要替换的整数值 |
例子
[C#]
Workbook workbook = new Workbook();
......
int newValue = 100;
workbook.Replace("AnOldValue", newValue);
[Visual Basic]
Dim workbook As Workbook = New Workbook()
........
im NewValue As Integer = 100
orkbook.Replace("AnOldValue", NewValue)
也可以看看
- class Workbook
- 命名空间 Aspose.Cells
- 部件 Aspose.Cells
Replace(string, double)
将单元格的值替换为新的双精度值。
public int Replace(string placeHolder, double newValue)
范围 | 类型 | 描述 |
---|---|---|
placeHolder | String | 单元格占位符 |
newValue | Double | 要替换的双倍值 |
例子
[C#]
Workbook workbook = new Workbook();
......
double newValue = 100.0;
workbook.Replace("AnOldValue", newValue);
[Visual Basic]
Dim workbook As Workbook = New Workbook()
........
im NewValue As Double = 100.0
orkbook.Replace("AnOldValue", NewValue)
也可以看看
- class Workbook
- 命名空间 Aspose.Cells
- 部件 Aspose.Cells
Replace(string, string[], bool)
将单元格的值替换为新的字符串数组。
public int Replace(string placeHolder, string[] newValues, bool isVertical)
范围 | 类型 | 描述 |
---|---|---|
placeHolder | String | 单元格占位符 |
newValues | String[] | 要替换的字符串数组 |
isVertical | Boolean | 真 - 垂直,假 - 水平 |
例子
[C#]
Workbook workbook = new Workbook();
......
string[] newValues = new string[]{"Tom", "Alice", "Jerry"};
workbook.Replace("AnOldValue", newValues, true);
[Visual Basic]
Dim workbook As Workbook = New Workbook()
.............
im NewValues() As String = New String() {"Tom", "Alice", "Jerry"}
orkbook.Replace("AnOldValue", NewValues, True)
也可以看看
- class Workbook
- 命名空间 Aspose.Cells
- 部件 Aspose.Cells
Replace(string, int[], bool)
用整数数组替换单元格的值。
public int Replace(string placeHolder, int[] newValues, bool isVertical)
范围 | 类型 | 描述 |
---|---|---|
placeHolder | String | 单元格占位符 |
newValues | Int32[] | 要替换的整数数组 |
isVertical | Boolean | 真 - 垂直,假 - 水平 |
例子
[C#]
Workbook workbook = new Workbook();
......
int[] newValues = new int[]{1, 2, 3};
workbook.Replace("AnOldValue", newValues, true);
[Visual Basic]
Dim workbook As Workbook = New Workbook()
..........
im NewValues() As Integer = New Integer() {1, 2, 3}
orkbook.Replace("AnOldValue", NewValues, True)
也可以看看
- class Workbook
- 命名空间 Aspose.Cells
- 部件 Aspose.Cells
Replace(string, double[], bool)
用双精度数组替换单元格的值。
public int Replace(string placeHolder, double[] newValues, bool isVertical)
范围 | 类型 | 描述 |
---|---|---|
placeHolder | String | 单元格占位符 |
newValues | Double[] | 要替换的双数组 |
isVertical | Boolean | 真 - 垂直,假 - 水平 |
例子
[C#]
Workbook workbook = new Workbook();
......
double[] newValues = new double[]{1.23, 2.56, 3.14159};
workbook.Replace("AnOldValue", newValues, true);
[Visual Basic]
Dim workbook As Workbook = New Workbook()
...........
Dim NewValues() As Double = New Double() {1.23, 2.56, 3.14159}
workbook.Replace("AnOldValue", NewValues, True)
也可以看看
- class Workbook
- 命名空间 Aspose.Cells
- 部件 Aspose.Cells
Replace(string, DataTable)
将单元格的值替换为来自DataTable.
public int Replace(string placeHolder, DataTable insertTable)
范围 | 类型 | 描述 |
---|---|---|
placeHolder | String | 单元格占位符 |
insertTable | DataTable | 要替换的数据表 |
例子
[C#]
Workbook workbook = new Workbook();
DataTable myDataTable = new DataTable("Customers");
// 将数据添加到 myDataTable
........
workbook.Replace("AnOldValue", myDataTable);
[Visual Basic]
Dim workbook As Workbook = New Workbook()
Dim myDataTable As DataTable = New DataTable("Customers")
'将数据添加到 myDataTable
............
workbook.Replace("AnOldValue", myDataTable)
也可以看看
- class Workbook
- 命名空间 Aspose.Cells
- 部件 Aspose.Cells
Replace(bool, object)
用新数据替换单元格的值。
public int Replace(bool boolValue, object newValue)
范围 | 类型 | 描述 |
---|---|---|
boolValue | Boolean | 要替换的布尔值。 |
newValue | Object | 新价值。可以是字符串、整数、双精度或日期时间值。 |
也可以看看
- class Workbook
- 命名空间 Aspose.Cells
- 部件 Aspose.Cells
Replace(int, object)
用新数据替换单元格的值。
public int Replace(int intValue, object newValue)
范围 | 类型 | 描述 |
---|---|---|
intValue | Int32 | 要替换的整数值。 |
newValue | Object | 新价值。可以是字符串、整数、双精度或日期时间值。 |
也可以看看
- class Workbook
- 命名空间 Aspose.Cells
- 部件 Aspose.Cells
Replace(string, string, ReplaceOptions)
用新字符串替换单元格的值。
public int Replace(string placeHolder, string newValue, ReplaceOptions options)
范围 | 类型 | 描述 |
---|---|---|
placeHolder | String | 单元格占位符 |
newValue | String | 要替换的字符串值 |
options | ReplaceOptions | 替换选项 |
也可以看看
- class ReplaceOptions
- class Workbook
- 命名空间 Aspose.Cells
- 部件 Aspose.Cells