I have functions which, in a nutshell, fixes capitalization for a list of capital words: < Pre> The problem I am facing now is that most input strings will be on average between 0 and 3 of these words. Obviously now I'm doing dozens (and possibly hundreds, in that array, there is an immoral tendency to grow over time) function calls that do not necessarily do anything. How can I get this code fast and get rid of unnecessary Function calls? Example input: My iPhone app has a user form under UIViewController when I start the application again, some of my UIVView will change its position and size. (These UIViews depend on the position of the keyboard) My fault is somewhere, I am trying to understand that when the application starts from the background and where the change in UIView can be made. You can include regexp in all your words, Can capture by adding. Using this, the function will provide enough information to restore the original word in the replacement. . var line = "some long string of text"; "Apple script", "Bluetooth", "DivX", "FireWire", "Garbageband", "iPhone", "iTunes", "iWork", "javaScript", "jquery", "macbook", " MySQL "," PowerBook "," PowerPoint "," QuickTime "," TextEdit "," TextMate ", // ..." Wi-Fi "," Xcode "," Xserve "," XMLHttpRequest "]. (Name) {line = line.replace (RegExp (name, "g"), name);});
function right (text, word) {return text.replace (RegExp ('\\ b (? :(' + words.join (') | (') + ')) \ \ B ',' ig '), function (m) {for (var a = arguments.length - 2; a--) if (logic [a]) return word [a1] || m;}); } Console.log (right ("My iPhone iTunes DivX FireWire app contains user form under UIVICI controller. When I resume the application, its status and size changes in some UIview (This is the position of the UVIS keyboard. Depending on my mistake somewhere, I am trying to understand that when the application from the background will resume and where the UIV changes. "" Apple Script "," Bluetooth "," DivX "," FireWire "," Garbageband "," iPhone "," ITunes "," iWeb "," iWork "," JavaScript "," jQuery "," MySQL "," PowerBook "," PowerPoint "," Quicktime "," TextEdit "," Textmat ", // ..." UIViewController "," UIView "," Wi-Fi "," Xcode "," Xserve "," XMLHttpRequest "])); My iPhone is the User Form in the iTunes UIUU-Controller in the iTunes DivX FireWire application. When I start the application again, some of my UIVView changes its position and size (these depend on the status of UIViews keyboard) Somewhere my fault is I am trying to understand that when applications from the background again And where changes in UIView can be made.
Comments
Post a Comment