QB / QB64 Discussion Forum      Other Subforums, Links and Downloads      Archived Pascal Resources    Search
 


comparing basic - fig - bash - python - js (function plus call)

by easylangs (Login easylangs)
Python and FIG Forum

 
'# public domain

function stripnv$(p$)                ' function stripnv(p)               # function stripnv { s=""                        # def stripnv(p):                      # function stripnv(p) {
    s$ = ""                          '     s = ""                        #     l=$(($(echo $1 | wc -c)-1))                #     s = ""                           # var s = "";
    for c = 1 to len(p$)             '     pl = p : len                  #     for c in $(seq 1 $l)                       #     for l in p:                      # for (c=0;c<p.length;c++) { 
        l$ = mid$(p$, c, 1)          '     for c = 1 pl 1                #         do l=$(echo $1 | cut -b $c)            #         if l in "aeiouAEIOU": s += l #      l = p.substring(c,c+1) ;
        io = instr("aeiouAEIOU", l$) '         l = p ; mid c 1           #         io=$(echo "aeiouAEIOU"|grep $l |wc -l) #     return s                         #      if ("aeiouAEIOU".indexOf(l) > -1) {
        if io > 0 then s$ = s$ + l$  '         io : instr "aeiouAEIOU" l #         if [[ "$io" != "0" ]]                  # vowels = stripnv("heya")             #          s+=$
        next                         '         iftrue io                 #             then s="$s$l"                      #                                      #          return s;
    stripnv$ = s$                    '         z = s : plus l : swap z s #             fi                                 #                                      #          }
    end function                     '         fig                       #             done                               #                                      # vowels = stripnv("heya");
vowels$ = stripnv$("heya")           '         next                      #     echo $s ; }                                #                                      #
                                     '     z : return s                  # vowels=$(stripnv heya)                         #                                      #
                                     '     fig                           #                                                #                                      #
                                     ' vowels = stripnv("heya") : print  #                                                #                                      #

Posted on Nov 30, 2017, 9:27 PM

Respond to this message   

Return to Index

 Copyright © 1999-2017 Network54. All rights reserved.   Terms of Use   Privacy Statement  

Quantcast