Since Arabic text is automatically reversed in PowerShell, I had to reverse-flip it to make it readable.
For example, the text 'مرحبا' , will look 'ابحرم'
I can change them one by one, but I have difficulty with many words at once.
function ReverseText {
Return ( -Join ($Args.ToCharArray() | Sort {(--$script:i)}) )
}
$AJoin = 'ابتثجحخدذرزسشصضطظعغفقكلمنهوي'
$AMatch = $AJoin.ToCharArray() -join '|'
$data = @(
"1. The verb for the male singular in Arabic is?"
" a) 'تفعل'"
" b) 'تفعلان'"
" c) 'يفعلون'"
" d) 'يفعل'"
"2. 'تلميذ' is the mufrad form of the word?"
" a) 'تلاميذ'"
" b) 'تلميذات'"
" c) 'تلميذان'"
" d) 'تلميذين'"
)
ReverseText 'بيتان'
$Newdata = $data | Foreach {
If ($_.Split("'") -match $AMatch) {
'configuous to continue'
}
}
$Newdata; pause
From the script, i can reserve one word 'بيتان' with command ReverseText 'بيتان'.
From $data, I want to change every Arabic word into reverse letter order, then save it in $Newdata. It's only 2 out of 50 taken from a .txt file, as example.
I'm not capable enough to do it yet.
I appreciate any helps. Thanks.
Out-GridView's GUI