Click or drag to resize

NameHelperShortenFileName Method

Framework to automate tests using Selenium WebDriver
Shortens the file name by removing occurrences of given pattern till length of folder + filename will be shorten than max Length.

Namespace: Ocaramba.Helpers
Assembly: OcarambaLite (in OcarambaLite.dll) Version: 1.0.0+d8e789f8644d1a9b63485ad7914acf4f489f3ef9
Syntax
C#
public static string ShortenFileName(
	string folder,
	string fileName,
	string pattern,
	int maxLength
)
Request Example

Parameters

folder  String
The folder.
fileName  String
The fileName.
pattern  String
The regular expression pattern to match.
maxLength  Int32
Max length.

Return Value

String
String with removed all patterns.
Example
How to use it:
C#
NameHelper.ShortenFileName(folder, correctFileName, "_", 255);
See Also