ios - How do I replace words in a text field to change into other words in another text field? -


this xcode 5 , ios apps; i'm working objective-c code.

okay example, if put first text field "i born in 1995." , when click convert button, want "i conceived circa 1995." how can go doing that? problem i'm having being able replace word word.

like, how return whats in text field replace possible words whatever person types in? sort of translator app, way replaced words.

my question concerns if user type text field, rephrase him words have synonyms other words.

yes, replacing substrings, but replace whatever user types it.

i understand stringbyreplacingoccurrencesofstring:withstring: makes sense, go after apply whatever user typed in?

basically, let's translator app. if type in: "i smart." rephrase to: "i intellectual." has deal whatever user types in.

if string in nsstring, can use stringbyreplacingoccurrencesofstring:withstring: method.

nsstring *str = @"i born in 1995.";  str = [str stringbyreplacingoccurrencesofstring:@"born in" withstring:@"conceived circa"]; 

not sure though if mean.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -