# Module: characterStringParsing

Contains all system defined business rules for parsing characters in strings.

Author:
  - Seth Hollingsead
Copyright:
  - Copyright © 2022-… by Seth Hollingsead. All rights reserved
Source:
  - businessRules/rules/stringParsing/characterStringParsing.js, line 1

### Requires

- module:characterArrayParsing
- module:ruleParsing
- module:configurator
- module:loggers
- @haystacks/constants
- path

### Methods

#### (inner) cleanCarriageReturnFromString(inputData, inputMetaData) → {string}

Cleans carriage return characters from the input data and trims off any leading or training spaces.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The string that should be scrubbed for carriage returns.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringParsing/characterStringParsing.js, line 254

##### Returns:

The same as the input string, but with all carriage return characters removed.

Type
  string

#### (inner) convertStringToLowerCase(inputData, inputMetaData) → {string}

Converts the input String to the same string but with no upper case letters.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The string that should have all upper case letters changed to lower case letters.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringParsing/characterStringParsing.js, line 282

##### Returns:

The corrected string with all lower case letters.

Type
  string

#### (inner) convertStringToUpperCase(inputData, inputMetaData) → {string}

Converts the input string to the same string but with no lower case letters.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The string that should have all lower case letters changed to upper case letters.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringParsing/characterStringParsing.js, line 305

##### Returns:

The corrected string with all upper case letters.

Type
  string

#### (inner) doesStringContainLowerCaseCharacter(inputData, inputMetaData) → {boolean}

Determines if the input string contains at least one lower case character or not.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The string that should be checked for lower case characters.
`inputMetaData` | string | Not used fro this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringParsing/characterStringParsing.js, line 357

##### Returns:

True or False to indicate if the string contains at least one lower case character or more, or not any lower case characters.

Type
  boolean

#### (inner) doesStringContainUpperCaseCharacter(inputData, inputMetaData) → {boolean}

Determines if the input string contains at least one upper case character or not.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The string that should be checked for upper case characters.
`inputMetaData` | string | Not used fro this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringParsing/characterStringParsing.js, line 328

##### Returns:

True or False to indicate if the string contains at least one upper case character or more, or not any upper case characters.

Type
  boolean

#### (inner) isFirstCharacterLowerCase(inputData, inputMetaData) → {boolean}

Determines if the first character of the string is a lower case character or not.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The string that should be checked to determine if the first character is lower case or not.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringParsing/characterStringParsing.js, line 386

##### Returns:

True or False to indicate if the first character of the string is a lower case character or not.

Type
  boolean

#### (inner) isFirstCharacterUpperCase(inputData, inputMetaData) → {boolean}

Determines if the first character of the string is an upper case character or not.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The string that should be checked to determine if the first character is upper case or not.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringParsing/characterStringParsing.js, line 409

##### Returns:

True or False to indicate if the first character of the string is an upper case character or not.

Type
  boolean

#### (inner) replaceCharacterAtIndexOfString(inputData, inputMetaData) → {string}

Replaces the character at a specified index with another character.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | array.<string, integer> | An array that contains the original string and the index of the character that should be replaced. inputData[0] = originalString - The string where the replacement should be made. inputData[1] = index - The index of the character where the replacement should be made.
`inputMetaData` | string | The character or string that should be used to make the replacement, inserted at the specified index.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringParsing/characterStringParsing.js, line 432

##### Returns:

The string after the replacement has been made.

Type
  string

#### (inner) replaceColonWithUnderscore(inputData, inputMetaData) → {string}

Replaces all colons in the input string with underscore symbols.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | A string that contains colons that should be converted to underscore symbols.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringParsing/characterStringParsing.js, line 230

##### Returns:

The same as the input String but with colon characters converted to underscore symbols.

Type
  string

#### (inner) replaceSpacesWithPlus(inputData, inputMetaData) → {string}

Replaces all spaces in the input string with plus symbols.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | A string that contains spaces that should be converted to plus symbols.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringParsing/characterStringParsing.js, line 206

##### Returns:

The same as the input string but with space characters converted to plus symbols.

Type
  string

#### (inner) singleQuoteSwapAfterEquals(inputData, inputMetaData) → {string}

Swaps single quote characters in the middle of the string wih double quote characters in the middle of the string. input: 'input[name='emailAddress'][class='username']' output: 'input[name="emailAddress"][class="username"]'

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | A string that contains text with single quotes that should be swapped for double quotes.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringParsing/characterStringParsing.js, line 30

##### Returns:

A string that contains text where single quotes have been exchanged for double quotes.

Type
  string

#### (inner) swapBackSlashToForwardSlash(inputData, inputMetaData) → {string}

Swaps all back slash characters in a string for forward slash characters.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | String that might contains some back slashes.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringParsing/characterStringParsing.js, line 105

##### Returns:

The same as the input string, just all back slash characters swapped for forward slash characters.

Type
  string

#### (inner) swapDoubleBackSlashToSingleBackSlash(inputData, inputMetaData) → {string}

Swaps all double back slash characters for single back slash characters.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | String that might contain some double back slashes.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringParsing/characterStringParsing.js, line 175

##### Returns:

The same as the input string, just all double back slash characters swapped for single back slash characters.

Type
  string

#### (inner) swapDoubleForwardSlashToSingleForwardSlash(inputData, inputMetaData) → {string}

Swaps all double forward slash characters for single forward slash characters.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | String that might contain some double forward slashes.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringParsing/characterStringParsing.js, line 140

##### Returns:

The same as the input string, just all double forward slash characters swapped for single forward slash characters.

Type
  string

#### (inner) swapForwardSlashToBackSlash(inputData, inputMetaData) → {string}

Swaps all forward slash characters in a string for back slash characters.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | String that might contain some forward slashes.
`inputMetaData` | string | Not used for this business rule.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/stringParsing/characterStringParsing.js, line 74

##### Returns:

The same as the input string, just all forward slash characters swapped for back slash characters.

Type
  string