Custom Search

Thursday, December 6, 2018

How to find repeated character from given dynamic string

str="i am busy at work in my company"
str=Replace(str," ","")
For i=1ToLen(str)-1
 IfLen(str)=0Then
  Exitfor
 EndIf
 k=Mid(str,1,1)
 IfInStr(Right(str,Len(str)-1),k)>0Then
  str2=str2&k
  str=Replace(str,k,"")
  Else
  str=Replace(str,k,"")
 EndIf
Next


MsgBox str2