tufanv Expert Licensed User Longtime User Jun 10, 2015 #1 Hello, in b4a i am using string functions library to create random string with 3 chars like : txtcountry.Text = s.RndChrGen(3,1) we dont have the library in b4i. How can i do stg like this ? TY
Hello, in b4a i am using string functions library to create random string with 3 chars like : txtcountry.Text = s.RndChrGen(3,1) we dont have the library in b4i. How can i do stg like this ? TY
Erel B4X founder Staff member Licensed User Longtime User Jun 10, 2015 #2 Which characters are allowed in this string? What is the second parameter? Upvote 0
tufanv Expert Licensed User Longtime User Jun 11, 2015 #3 only a to z I want it to create for example : ple,fkq,xju etc.. random 3 charachters from a to z. Erel said: Which characters are allowed in this string? What is the second parameter? Click to expand... Upvote 0
only a to z I want it to create for example : ple,fkq,xju etc.. random 3 charachters from a to z. Erel said: Which characters are allowed in this string? What is the second parameter? Click to expand...
Erel B4X founder Staff member Licensed User Longtime User Jun 11, 2015 #4 B4X: Sub GenerateRandomString(Length As Int) As String Dim sb As StringBuilder sb.Initialize For i = 1 To Length sb.Append(Chr(Rnd(Asc("a"), Asc("z") + 1))) Next Return sb.ToString End Sub Upvote 0
B4X: Sub GenerateRandomString(Length As Int) As String Dim sb As StringBuilder sb.Initialize For i = 1 To Length sb.Append(Chr(Rnd(Asc("a"), Asc("z") + 1))) Next Return sb.ToString End Sub