# Module: characterArrayParsing

Contains all system defined business rules for array parsing with a focus on characters.

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

### Requires

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

### Methods

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

Parses through all the elements of an array and determines if any one of them contains the input character.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | boolean | integer | object | The character that should be searched for in the array of elements.
`inputMetaData` | array.<(string|boolean|integer|object)> | The array that should be searched for the specified character/value/etc...

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/arrayParsing/characterArrayParsing.js, line 68

##### Returns:

True or False to indicate if the value was found or not found.

Type
  boolean

#### (inner) removeCharacterFromArray(inputData, inputMetaData) → {array.<(string|boolean|integer|object)>}

Removes all instances of a character or value from all array elements.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | integer | boolean | float | object | The character, integer, boolean, float or object that should be removed from all instances of the input array.
`inputMetaData` | array.<(string|boolean|integer|object)> | The array from which all instances of the input character, integer, etc...should be removed.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/arrayParsing/characterArrayParsing.js, line 97

##### Returns:

The array after having the specified character removed from all elements of the input array.

Type
  array.<(string|boolean|integer|object)>

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

Replaces a character at the specified index with another character.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | The string which should have the specified character changed, then returned.
`inputMetaData` | array.<integer, string> | An array with an integer of what index the character should be replaced, and a string with the character or characters that should be inserted at the specified index.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/arrayParsing/characterArrayParsing.js, line 127

##### Returns:

The modified string.

Type
  string

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

Replaces all of the specified character in the inputData with another specified character.

##### Parameters:

Name | Type | Description
--- | --- | ---
`inputData` | string | A string that may or may not contain the specified characters that should be converted to another specified character.
`inputMetaData` | array.<string, string> | An array of data that contains 2 additional string parameters: inputMetaData[0] === character2Find - The character to be searched and replaced from the input string. inputMetaData[1] === character2Replace - The character that should be used to replace the character specified for replacement from the input data.

Author:
  - Seth Hollingsead
Source:
  - businessRules/rules/arrayParsing/characterArrayParsing.js, line 30

##### Returns:

The same as the input string but with specified characters converted to the other specified character.

Type
  string