Posted By

erne100 on 01/07/11


Tagged


Versions (?)

Zamiana polskich znaków na angielskie


 / Published in: Visual Basic
 

  1. Option Explicit
  2.  
  3. Public Function pol2eng(sSource As String) As String
  4.  
  5. Dim iCounter As Integer
  6. Dim sDestination As String
  7. Dim aPolish As Variant
  8. Dim aEnglish As Variant
  9.  
  10. aPolish = Array("ą", "ć", "ę", "ł", "ń", "ó", "ś", "ż", "ź", "Ą", "Ć", "Ę", "Ł", "Ń", "Ó", "Ś", "Ż", "Ź")
  11. aEnglish = Array("a", "c", "e", "l", "n", "o", "s", "z", "z", "A", "C", "E", "L", "N", "O", "S", "Z", "Z")
  12.  
  13. sDestination = sSource
  14. For iCounter = LBound(aPolish) To UBound(aEnglish)
  15. sDestination = Replace(sDestination, aPolish(iCounter), aEnglish(iCounter))
  16. Next iCounter
  17.  
  18. pol2eng = sDestination
  19.  
  20. End Function

Report this snippet  

You need to login to post a comment.