Alphabet Structure - MetaTrader 5 Library | MT5 EA Download - MetaTrader 5 Resources
This structure provides quick access to lowercase and uppercase Latin and Russian characters, numbers, punctuation, brackets, spaces, and special sets of symbols where spaces should be removed before and after.
I find this useful in applications where text data needs to be manipulated.
The alphabet also contains methods for classifying characters/text.
letters abc; /*report*/ print ( "russian" ); array print (abc.rus.cap.codes); ArrayPrint (abc.rus.cap.syms); array print (abc.rus.low.codes); ArrayPrint (abc.rus.low.syms); print ( "Latin" ); array print (abc.lat.cap.codes); ArrayPrint (abc.lat.cap.syms); Array printing (abc.lat.low.codes); ArrayPrint (abc.lat.low.syms); print ( "number" ); ArrayPrint (abc.Number.Code); Array printing (abc.digit.syms); print ( "punctuation" ); Array printing (abc.punct.codes); Array printing (abc.punct.syms); print ( "No space before" ); Array printing (abc.nospacebefore.codes); Array printing (abc.nospacebefore.syms); print ( "No space after" ); Array printing (abc.nospaceafter.codes); Array printing (abc.nospaceafter.syms); print ( "wrap" ); Array printing (abc.wrapmarker.codes); ArrayPrint (abc.wrapmarker.syms); print ( "blank" ); Array printing (abc.whitesp.codes); ArrayPrint (abc.whitesp.syms); print ( "brackets" ); Array printing (abc.bracket.codes); Array printing (abc.bracket.syms); print ( "view" ); ENUM_ALPHABET_CAT category; /**/ Thin string character []= { "\\" , "(" , "7" , "$" , "abc" }; integer size string char = array_size (string char); for ( integer i = 0 ; i < size string char; i++) { string string char = string char[i]; Category=abc.Check(stringchar); Print (string character, "is" , enumeration to string (category)); } /**/ Short code[]= { '' , ',' , '\n' , 0 }; integer size code = array_size (code); for ( integer i = 0 ; i < size code; i++) { shortcode = code[i]; Category=abc.Check(code); Print (code, "Yes" , enumeration to string (category)); } /**/ ENUM_ALPHABET_CAT category[]; string text = "Some text." ; Integer qty=abc.Check(text,category); Printing format ( "'%s' consists of %d class symbols:" , text, quantity); integer size = array_size (category); for ( integer i = 0 ; i < size; i++) { print ( enumeration to string (category[i]));} }
Russian[0] 1040 1041 1042 1043 1044 1045 1025 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055
[17] 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071
"А" "Б" "В" "Г" "Д" "Е" "Ё" "Ж" "З" "И" "Й" "К" "Л" "М" "Н" "О" "П" "Р" "С" "Т" "У" "Ф" "Х" "Ц" "Ч" "Ш" "Щ" "Ъ" "Ы" "Ь" "Э" "Ю" "Я"
[0] 1072 1073 1074 1075 1076 1077 1105 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087
[17] 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103
"а" "б" "в" "г" "д" "е" "ё" "ж" "з" "и" "й" "к" "л" "м" "н" "о" "п" "р" "с" "т" "у" "ф" "х" "ц" "ч" "ш" "щ" "ъ" "ы" "ь" "э" "ю" "я"
Latin 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
"A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z"
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
"a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z"
Numbers 48 49 50 51 52 53 54 55 56 57
"0" "1" "2" "3" "4" "5" "6" "7" "8" "9"
Punctuation 46 44 59 58 33 63 43 61 42 96 126 39 34 92 47 45 8212 8211
"." ","";" ":""!" "?" "+" "= "*" "`" "~" "'" """ "\" "/" "-" "—" "–"
No space in front 46 44 58 59 63 33 41 93 62 125 45 8212 8211
"." ","":"";" "?" "!" ")" "]" ">" "}" "-" "—" "–"
No space after 40 91 60 123 45 8212 8211
"(""[""<""{""-""—""—"
WRAP
44 93 63 33 32
",""]""?" "!" ""
Blank 32 9 13
" "" "" "
Bracket 40 41 91 93 123 125 60 62
"(" ")" "[" "]" "{" "}" "<" ">"
Check \ is CHAR_PUNCT
(is CHAR_BRACKET
7 is CHAR_DIGIT
$ is CHAR_UNDEF
abc is ENUM_ALPHABET_CAT::-1
32 is CHAR_WHITESP
44 is CHAR_PUNCT
10 is CHAR_BREAK
0 is CHAR_NULL
"Some text." consists of 4 types of symbols:
CHAR_LAT_CAP
CHAR_LAT_LOW
CHAR_WHITESP
CHAR_PUNCTAttachment download
📎 alphabet.mq5 (4 KB)
📎 alphabet.mqh (17.9 KB)
Source: MQL5 #29514
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •