Advanced Software Engineering
Advanced_Software_Engineering.HelperFunctions Class Reference

This class simply provides settings and some functions that are used across many components. More...

Static Public Member Functions

static string Strip (string text)
 This function removes spaces from the start and the end of the text. This should be unit tested. More...
 
static List< string > StripStringArray (string[] array)
 Strips the strings of the full array. See Strip(string) More...
 
static CommandAndParameterParserResult CommandAndParameterParser (string text)
 Parses the commands into a directry that Commander can use. See Commander More...
 

Detailed Description

This class simply provides settings and some functions that are used across many components.

Member Function Documentation

◆ CommandAndParameterParser()

static CommandAndParameterParserResult Advanced_Software_Engineering.HelperFunctions.CommandAndParameterParser ( string  text)
static

Parses the commands into a directry that Commander can use. See Commander

Parameters
textA string command
Returns
Directory with the command and its parameters cleanly separated

◆ Strip()

static string Advanced_Software_Engineering.HelperFunctions.Strip ( string  text)
static

This function removes spaces from the start and the end of the text. This should be unit tested.

Parameters
textSimply any string of any size
Returns
A string without spaces at the begining or the end

For example

string a = " a simple sentence surrounded by spaces ";
string b = StripSpaces(a);
Console.WriteLine(b); // => "a simple sentence surrounded by spaces";

The code won't remove internal double spaces:

string a = " a simple sentence surrounded by spaces ";
string b = StripSpaces(a);
Console.WriteLine(b); // => "a simple sentence surrounded by spaces";

◆ StripStringArray()

static List<string> Advanced_Software_Engineering.HelperFunctions.StripStringArray ( string[]  array)
static

Strips the strings of the full array. See Strip(string)

string[] tmp = {" text ", " ", " with", "spaces ", ""}; Console.WriteLine(StripStringArray(tmp)); // => {"text", "with", "spaces"}

Parameters
arrayDirty array with spaces
Returns
A stripped aray

The documentation for this class was generated from the following file: