#Major . Posted February 21, 2019 Share Posted February 21, 2019 كيف اقدر احذف اي رقم فيه 4 مثلا 14 | 4 |40 |41 الخ Link to comment
Rakan# Posted February 22, 2019 Share Posted February 22, 2019 10 hours ago, [AcM] - Major . said: كيف اقدر احذف اي رقم فيه 4 مثلا 14 | 4 |40 |41 الخ وضح . تقصد تمسح الرقم من السترنق استعمل string.gsub واذا ماكان قصدك كذا وضح اكثر , حط كودك ووضح Link to comment
KillerX Posted February 22, 2019 Share 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 Link to comment
MR.M1 Posted February 22, 2019 Share Posted February 22, 2019 برجاء التوضيح لاني مافهمت شي Link to comment
TOUNSI |, السعأدة Posted February 22, 2019 Share Posted February 22, 2019 46 minutes ago, Kareem Amer said: برجاء التوضيح لاني مافهمت شي وانت من امتى تفهم 2 1 Link to comment
MR.M1 Posted February 22, 2019 Share Posted February 22, 2019 1 hour ago, TOUNSI | ا̍ڸــڛۣــ؏ــٰٱ̍دہ said: وانت من امتى تفهم اقولق من امتي ومتزعلشش ؟ Link to comment
nxFairlywell Posted February 22, 2019 Share 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 Link to comment
KillerX Posted February 22, 2019 Share Posted February 22, 2019 @!#DesTroyeR_,) what ?? 1 Link to comment
Doffy Posted February 22, 2019 Share Posted February 22, 2019 3 minutes ago, KillerX said: @!#DesTroyeR_,) what ?? اقول نط خاص بس 1 Link to comment
KillerX Posted February 22, 2019 Share Posted February 22, 2019 (edited) @NX_CI سؤال : string.gsub ايه هو الفرق بين وظيفتك والفرق بين وظيفة ?_? Edited February 22, 2019 by KillerX Link to comment
nxFairlywell Posted February 22, 2019 Share Posted February 22, 2019 16 minutes ago, KillerX said: @NX_CI سؤال : string.gsub ايه هو الفرق بين وظيفتك والفرق بين وظيفة ?_? مافيه فرق , فقط انا اختصرت العجين اللي انت مسويه و سويت لوب عشان يتحقق من الحروف الموجوده في السترنق اذا ماكانت تساوي الرقم اللي هو حاطه Link to comment
KillerX Posted February 22, 2019 Share Posted February 22, 2019 (edited) 3 minutes ago, NX_CI said: مافيه فرق , فقط انا اختصرت العجين اللي انت مسويه و سويت لوب عشان يتحقق من الحروف الموجوده في السترنق اذا ماكانت تساوي الرقم اللي هو حاطه بس انتا اللي فهمك عجين انا قولتلوا فوق علي حسب اللي فهمتوا منوا مثلا هو يبي يحذف رقم مش مركب مش يحذف كلوا Edited February 22, 2019 by KillerX Link to comment
nxFairlywell Posted February 22, 2019 Share 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 Link to comment
#Major . Posted February 22, 2019 Author Share 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") Link to comment
nxFairlywell Posted February 22, 2019 Share 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 Link to comment
#Major . Posted February 24, 2019 Author Share Posted February 24, 2019 On 22/02/2019 at 20:04, NX_CI said: WoW what? Link to comment
Guest Posted February 24, 2019 Share Posted February 24, 2019 2 hours ago, [AcM] - Major . said: what? بيقولك واو, يعني نايسسس ' شني يعني ._. Link to comment
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