#Major . Posted February 21, 2019 Posted February 21, 2019 كيف اقدر احذف اي رقم فيه 4 مثلا 14 | 4 |40 |41 الخ
Rakan# Posted February 22, 2019 Posted February 22, 2019 10 hours ago, [AcM] - Major . said: كيف اقدر احذف اي رقم فيه 4 مثلا 14 | 4 |40 |41 الخ وضح . تقصد تمسح الرقم من السترنق استعمل string.gsub واذا ماكان قصدك كذا وضح اكثر , حط كودك ووضح
KillerX Posted February 22, 2019 Posted February 22, 2019 (edited) علي حسب ما فهمت منك ان انتا تبي تحذف رقم 4 لحالوا بدون ما تحذف رقم 4 من الارقام المركبة مثل 14 و 54 و الخ function removeNumberFromString( number , string ) local index1 , index2 , before , after index1 , index2 = string:find( number ) while index1 and index2 do before , after = string:sub(index1-1,index1-1),string:sub(index2+1,index2+1) if( tonumber( before ) == nil and tonumber( after ) == nil ) then string = string:gsub( string:sub( index1-1 , index2+1 ) , string:sub( index1-1 , index1-1 ) .. string:sub( index2+1 , index2+1 ) ) end index1 , index2 = string:find( number , index2+1 ) end return string end Edited February 22, 2019 by KillerX 1
TOUNSI |, السعأدة Posted February 22, 2019 Posted February 22, 2019 46 minutes ago, Kareem Amer said: برجاء التوضيح لاني مافهمت شي وانت من امتى تفهم 2 1
MR.M1 Posted February 22, 2019 Posted February 22, 2019 1 hour ago, TOUNSI | ا̍ڸــڛۣــ؏ــٰٱ̍دہ said: وانت من امتى تفهم اقولق من امتي ومتزعلشش ؟
nxFairlywell Posted February 22, 2019 Posted February 22, 2019 (edited) function removeValueFromString(string,value) if type(string) == "string" then value = ( type(value) == "string" and value ) or ( type(value) == "number" and tostring(value) ); local result = string.gsub(string,value,""); local aBoolean = true for i = 1, string.len(result) do if ( string.sub(result,i,i) == value ) then aBoolean = false break return aBoolean end end return result end return false end Edited February 22, 2019 by NX_CI
Doffy Posted February 22, 2019 Posted February 22, 2019 3 minutes ago, KillerX said: @!#DesTroyeR_,) what ?? اقول نط خاص بس 1
KillerX Posted February 22, 2019 Posted February 22, 2019 (edited) @NX_CI سؤال : string.gsub ايه هو الفرق بين وظيفتك والفرق بين وظيفة ?_? Edited February 22, 2019 by KillerX
nxFairlywell Posted February 22, 2019 Posted February 22, 2019 16 minutes ago, KillerX said: @NX_CI سؤال : string.gsub ايه هو الفرق بين وظيفتك والفرق بين وظيفة ?_? مافيه فرق , فقط انا اختصرت العجين اللي انت مسويه و سويت لوب عشان يتحقق من الحروف الموجوده في السترنق اذا ماكانت تساوي الرقم اللي هو حاطه
KillerX Posted February 22, 2019 Posted February 22, 2019 (edited) 3 minutes ago, NX_CI said: مافيه فرق , فقط انا اختصرت العجين اللي انت مسويه و سويت لوب عشان يتحقق من الحروف الموجوده في السترنق اذا ماكانت تساوي الرقم اللي هو حاطه بس انتا اللي فهمك عجين انا قولتلوا فوق علي حسب اللي فهمتوا منوا مثلا هو يبي يحذف رقم مش مركب مش يحذف كلوا Edited February 22, 2019 by KillerX
nxFairlywell Posted February 22, 2019 Posted February 22, 2019 21 hours ago, [AcM] - Major . said: كيف اقدر احذف اي رقم فيه 4 مثلا 14 | 4 |40 |41 الخ يمكن انا فهمته خطأ , بس هو قال يبغى يحذف ( اي ) رقم فيه رقم 4 104 114 4 404 41 48 .........etc 1 1
#Major . Posted February 22, 2019 Author Posted February 22, 2019 خلاص سويتها شكرا لكم استخدمت js function loop(){ var input = document.getElementById("input").value; var h = document.getElementById("FALSH").innerHTML let aa = 0; for(let b = 0;b < input;b++){ b = `${b}`; if(!b.includes("4")){ aa++ }} $("#myAlert").removeClass("in")
nxFairlywell Posted February 22, 2019 Posted February 22, 2019 30 minutes ago, [AcM] - Major . said: خلاص سويتها شكرا لكم استخدمت js function loop(){ var input = document.getElementById("input").value; var h = document.getElementById("FALSH").innerHTML let aa = 0; for(let b = 0;b < input;b++){ b = `${b}`; if(!b.includes("4")){ aa++ }} $("#myAlert").removeClass("in") WoW
#Major . Posted February 24, 2019 Author Posted February 24, 2019 On 22/02/2019 at 20:04, NX_CI said: WoW what?
Guest Posted February 24, 2019 Posted February 24, 2019 2 hours ago, [AcM] - Major . said: what? بيقولك واو, يعني نايسسس ' شني يعني ._.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now