Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class StringManipulate
- {
- public char[] StringToChar(string Word)
- {
- char[] myChar = Word.ToCharArray();
- //zwraca łancuch znaków w postaci tablicy znaków
- return myChar;
- }
- public int[] CharToAscii(char[] Letter)
- {
- int i = 0;
- int[] temp = new int[Letter.Length];
- while (i < Letter.Length)
- {
- temp[i] = (int)Letter[i];
- i++;
- }
- //zwraca tablice intow z zawartoscia kodu asci
- return temp;
- }
- public bool CheckWordRangeOfAscii(int rangeForm, int rangeTo, int[] valueOfArray)
- {
- bool temp=true;
- foreach(int item in valueOfArray)
- {
- if (item >= rangeForm || item <= rangeTo)
- temp = true;
- else temp = false;
- }
- return temp;
- }
- public bool CheckTrueCheckFalse(bool value)
- {
- if (value == true)
- return true;
- return false;
- }
- public bool CheckWord(string Word, int rangeForm, int rangeTo)
- {
- char[] arrayChar = StringToChar(Word);
- return CheckTrueCheckFalse(CheckWordRangeOfAscii(rangeForm, rangeTo, (CharToAscii(StringToChar(Word)))));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement