Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

pick random word in sentence of varying length

Featured Replies

Hello

I have a situation that I would like to make a calculation to pick a random word in a sentence of varying length change it to a "_______" and paste in the field "missing word" . I don't know if this is possible because of the length of the sentence being variable . Also since this will be used for an english drill I would be looking for words longer than 4 letters. This may be too difficult. But thanks for answers

Ps If the word didn't look like the best choice to restore to original sentence and try again. More Thanks

Hello journeyman,

It sounds like you want the Substitute() function. Assume your text is in a field called Text and you use a global text field called gString where you type in the phrase or words you wish to find in the text. Then calculation (result is text) would be:

Substitute ( Text ; gString ; "missing word" )

I didn't get the underline part. Maybe an example will help us pin down a calculation for you. :-)

  • Author

Thank you so much. That is exactly what I am looking for. But I would like to have the "_______" to show up without the last letter. I can't figure it out . _______ instead of ______s etc. Thanks so much

Is it possible the calculation could overlook certain words if I could put in a list?

Like "the" "be" "Matthew" etc?

Comment's file works perfectly for me. Can you post the calculation you are using?

  • Author

I am using the calc that comment posted because it works so well with the exceptions I just mentioned. Thanks I hope comment will amend the calc so I can get rid of the last letter on the "________" (blank)

Please post an example of a sentence and word number that produce the problem.

  • Author

I am so sorry - My sentences had quotations around them and that caused the problem.

I still wish there was a way to use your file but not use certain words that i could make a list of that would become random.

try to add:

and IsEmpty ( FilterValues ( ValueListItems ( Get ( FileName ) ; "YourValueList" ) ; MiddleWords ( Sentences::Sentence ; $n ; 1 ) ) )

to the calculation for the Exit Loop If [ ] script step.

P.S.: YourValueList is the name of the value list of the exceptions.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.