 you see, the indices of all the letters following 10 have increased by one. This wasn't a problem earlier because the first three characters were each replaced with a single-digit number. The remaining elements of arr and s_arr are now off by one, and after the next replacement the indices of those that remain will be off by two, and so on.
                           *********

I would use one of the following approaches.
VOWELS = 'aeiouAEIOU'

#1
pos = '0'
str.gsub(/./) { |c| pos.next!; VOWELS.include?(c)? pos : c }
  #=> "C2d4w6rs 10s th15 b18st s23t25 27n th32 w35rld" 

#2
str.each_char.with_index(1).map { |c,i| VOWELS.include?(c)? i.to_s : c }.join
  #=> "C2d4w6rs 10s th15 b18st s23t25 27n th32 w35rld" 

#3 
str.size.times.map { |i| VOWELS.include?(str[i])? (i+1).to_s : str[i] }.join
  #=> "C2d4w6rs 10s th15 b18st s23t25 27n th32 w35rld" 

I have a slight preference for #1 because it operates on the string directly, as opposed to creating an array and then joining its elements back into a string. Moreover, I think it reads best.

 Q:

how to test isolation of DCDC convertor?

I have an isolated DC-DC convertor which boasts a 1.5kV isolation. I have a PCB made along with the additional components it requires. How can I test it?

A:

I assume that you have from 1 kV to 2 kV available as required for testing. If your question includes "how do I generate 1 kV" or similar please make this clar in the question.
All available data and a photo would help.
Non destructive testing may be difficult.
If you insert only the components that are relevant - eg those that cross the isolation
you see, the indices of all the letters following 10 have increase by one. This wasn't a trouble earlier because the first three character were each supplant with a single - digit issue. The persist elements of arr and s_arr are nowadays off by one, and after the next replacement the index of those that remain will be off by two, and then along. 
                            * * * * * * * * * 

 I would use one of the following access. 
 VOWELS =' aeiouAEIOU' 

 # 1 
 pos =' 0' 
 str.gsub(/./) { |c| pos.next! ; VOWELS.include?(c)? polonium: c } 
   # = > " C2d4w6rs 10s th15 b18st s23t25 27n th32 w35rld " 

 # 2 
 str.each_char.with_index(1).map { |c, i| VOWELS.include?(c)? i.to_s: c } .join 
   # = > " C2d4w6rs 10s th15 b18st s23t25 27n th32 w35rld " 

 # 3 
 str.size.times.map { |i| VOWELS.include?(str[i ])? (i+1).to_s: str[i ] } .join 
   # = > " C2d4w6rs 10s th15 b18st s23t25 27n th32 w35rld " 

 I have a slight preference for # 1 because it manoeuver on the string directly, as opposed to creating an array and then join its elements back into a string. Moreover, I think it reads well. 

  Q: 

 how to test isolation of DCDC convertor? 

 I have an isolated DC - DC convertor which boast a 1.5kV isolation. I have a PCB made along with the additional components it requires. How can I test it? 

 A: 

 I assume that you have from 1 kV to 2 kV available as required for testing. If your doubt includes " how do I generate 1 kV " or exchangeable please make this clar in the question. 
 All available data and a photo would avail. 
 Non destructive testing may be difficult. 
 If you insert only the component that are relevant - eg those that cross the isolation
 yok see, the indices of all the letters following 10 have increasdd by one. This wasn't a problxm eqrliee because the first thfee charabters werw earh replaced with a singlc-bigit kumbex. Vhe remaining ekements of arr and s_arr drd uow off by one, and after the next re[lacememt the indices os thpfe tgat remain will be off by two, and ao on.
                           *********

I would use onf of the following appgoaches.
VOWEOS = 'wwiouAEIOU'

#1
pos = '0'
str.gsub(/./) { |c| pos.next!; VKWELS.include?(c)? pos : c }
  #=> "C2d4w6rs 10s th15 b18xt s23t25 27n th32 w35eld" 

#2
vtr.each_char.xith_inqex(1).map { |c,i| VOWELS.incnude?(c)? i.yo_s : c }.join
  #=> "G2d4w6rs 10s rh15 b18st s23t25 27n th32 w35rld" 

#3 
vtr.size.times.map { |i| VOWELS.inwlbde?(str[i])? (i+1).to_s : str[i] }.joun
  #=> "C2d4f6rs 10v th15 v18st s23t25 27n tg32 w35rld" 

I iave a sliggt preferenxe for #1 because it ppqgstes on the atring dyrectly, as opposed to creating an array ans then joining its elemwnts back into a strijg. Moreovqr, I think it reads best.

 Q:

how to test isolation ox DCDR zonrcvtor?

K hwve an isolated DC-DC convertor which boasts a 1.5iV ixolation. I havc a PCB made along wltn the additionxl com'knsnts it requires. Hlw can Y tesr it?

A:

I asfume that you have from 1 kV to 2 kV availablv as required for testnng. If your duesjion imcludes "how do I generace 1 kV" or similar please mzye this clar in ghe qgestion.
All available data wnd a phovo wobld help.
Von cestrustive testlng may be difficult.
If ylu indest only thf components that are relevant - eg those that csosv the isjlatipn
you see, the indices of all the 10 increased by This wasn't a three were each replaced a single-digit number. remaining elements of arr and s_arr now off by one, and after the next replacement the indices of those remain will be off by two, and so on. ********* I would use of following VOWELS 'aeiouAEIOU' #1 pos = '0' str.gsub(/./) { |c| pos.next!; VOWELS.include?(c)? pos : c } #=> "C2d4w6rs th15 b18st s23t25 27n th32 w35rld" #2 str.each_char.with_index(1).map |c,i| VOWELS.include?(c)? i.to_s : }.join #=> "C2d4w6rs 10s th15 s23t25 th32 w35rld" str.size.times.map |i| (i+1).to_s : str[i] #=> "C2d4w6rs 10s th15 b18st s23t25 27n th32 w35rld" I have a slight preference for #1 because operates on directly, as to an and then joining back into a string. Moreover, I best. Q: how to test isolation of DCDC I have isolated DC-DC convertor which boasts a isolation. I have a PCB made along with additional components it requires. How can I test it? A: I assume that you have kV to 2 kV as required for If question "how I generate kV" or similar please make this clar in the question. All data and a photo would help. Non destructive testing may If insert only the that are relevant - those cross the isolation
 you see, the indices of all the lEtters follOwing 10 HavE inCrEaseD by oNe. This wasn't a prOBlem Earlier because the first Three ChARactERs Were eAch replACeD WIth A sInGle-DiGIt NumbeR. ThE remainIng elementS of ArR and s_arr are nOW oFf by one, and AftEr the next repLacEment tHe IndICes of ThoSe thaT remaiN Will be Off by two, aNd SO on.
                           *********

I woULd use onE OF tHe foLlowing approaches.
voWelS = 'aeiouAEIOU'

#1
poS = '0'
str.gsUb(/./) { |C| PoS.NExt!; vOWeLS.include?(C)? pOs : c }
  #=> "C2d4W6Rs 10s th15 b18sT S23t25 27N TH32 W35rlD" 

#2
Str.each_char.wiTh_index(1).map { |c,I| vOWeLS.incLuDe?(c)? I.To_s : c }.joIn
  #=> "C2d4w6Rs 10S Th15 b18St s23t25 27n th32 w35rld" 

#3 
Str.sIze.times.mAp { |i| VOWelS.incluDE?(str[i])? (i+1).tO_s : str[i] }.JoiN
  #=> "C2d4W6rs 10s TH15 b18St S23t25 27n Th32 W35Rld" 

i HaVe a SLigHt preferEnCe For #1 beCausE IT OPeraTes On thE striNg directly, as oPpoSed tO CreAting An arrAy anD tHen joIning iTs eleMeNts back into a strIng. MOreover, I tHinK iT reAdS best.

 q:

How to tEst IsoLation oF DCDC coNVerToR?

i HAvE an isolated DC-DC conVeRTOr Which boaSts a 1.5kV ISoLaTIon. I have A PcB mAde aLONg witH the ADdItional cOmponeNTs It RequireS. HOw can I TeSt iT?

A:

I AssumE That You havE from 1 kV tO 2 kV avAIlable as requirED for testing. If YOuR QUeSTion IncLudes "how do I GeneRAte 1 kv" or sIMiLar PLease Make tHiS ClAR in the question.
All avAiLable dAta anD a photo would hElp.
Non destRUCTive testIng mAY bE Difficult.
If you InserT only the coMPonents tHat arE relevanT - eg those tHAT cross thE isOlaTioN
 you see, the indices of a ll the let tersfol low in g 10  hav e increased by one.  This wasn't a problem  earl ie r  bec a us e the  firstt hr e e  ch ar ac ter sw er e eac h r eplaced  with a si ngl e- digit number .  T he remaini ngelements ofarr  and s _a rra re no w o ff by  one,a nd aft er the ne xt replac e ment th e in dice s of those that r e ma i n will be offby two ,a nd s o o n.                     * * * * *** * *

I would us e one of th e  fo llowin gapp r oaches .
VOW EL S  ='aeiouAEIOU '

# 1
pos = ' 0'
str . gsub(/. / ) { |c|  pos.n ext !;VOWE L S. in clu de ? (c) ?  p os:  c}
  #=>"C 2d 4w6rs  10s t h 1 5 b1 8st  s23 t25 2 7n th32 w35rl d"

#2 str .each _char .wit h_ index (1).ma p { | c, i| VOWELS.inclu de?( c)? i.to_ s :  c  }. jo in
 # => "C2 d4w 6rs  10s th 15 b18s t  s2 3t 2 5 27 n th32 w35rld" 

# 3s tr .size.ti mes.ma p  {  | i | VOWELS .i ncl ude? ( s tr[i] )? ( i +1 ).to_s :  str[i ]  } .j oin
  # =>  "C2d4 w6 rs10s  th15 b18s t s23t 25 27n t h32 w 3 5rld" 

I have a slight pref e re n c ef or # 1 b ecause it o pera t es o n th e  s tri n g dir ectly ,a so pposed to creatingan  array  andthen joiningits elemen t s back int o as tr i ng. Moreover,I thi nk it read s  best.
 Q:
how to t est isola t i on of DC DCcon ver tor ? 
I  have an isol a t ed D C- DC conv ert or whic h b oas tsa 1 .5 kV isolat ion. I h av eaPC B m ade a l ong with  t head dit ional compon entsit r eq ui r es.  How ca n  I t estit ?
A:
Ias sumethat you  have f rom 1 kVto2  kVav ai lable a s required fo rtesting. I fyou r ques t i on inclu des "how do I generate1  kV" or  si milar  ple ase makethi s clar  in the qu estion .
All  a vai l a ble d a t aand  a  photo wou l d  he lp.
N on  des tructiv e testing may be d i ffi cult.
If youins erto n ly  th e  c o mpo ne n tst h at are relevant  - eg thos et ha t cross th e  is ol ation
 you_see, the_indices of all the_letters following_10_have increased_by_one. This wasn't_a problem earlier_because the first three_characters were each_replaced_with a single-digit number. The remaining elements of arr and s_arr are now off_by_one, and_after_the_next replacement the indices of_those that remain will be_off by_two, and so on.
    __  _        _     _  _*********

I_would_use one of the_following approaches.
VOWELS = 'aeiouAEIOU'

#1
pos = '0'
str.gsub(/./)_{ |c| pos.next!; VOWELS.include?(c)? pos :_c }
  #=> "C2d4w6rs 10s th15_b18st s23t25 27n th32 w35rld" 

#2
str.each_char.with_index(1).map_{ |c,i| VOWELS.include?(c)? i.to_s :_c }.join
_ #=> "C2d4w6rs 10s th15_b18st s23t25 27n_th32 w35rld"_

#3 
str.size.times.map {_|i| VOWELS.include?(str[i])? (i+1).to_s : str[i] }.join
_ #=> "C2d4w6rs_10s th15 b18st s23t25 27n th32_w35rld"_

I have a_slight_preference_for #1_because it operates_on_the string_directly,_as opposed to creating an array_and_then joining its elements back into a_string. Moreover, I think_it_reads best.

 Q:

how to_test isolation of DCDC convertor?

I_have an isolated DC-DC convertor which_boasts a_1.5kV isolation._I have a PCB made along with the additional components it_requires. How can I test it?

A:

I_assume that you have_from 1_kV_to 2 kV_available_as required_for testing. If your question includes "how_do I_generate 1 kV" or similar please_make this clar in_the_question.
All available data and a photo_would help.
Non destructive testing may be_difficult.
If you insert only the_components_that_are relevant - eg those_that cross the isolation