selectedText - returns the current text selection or and empty string
548892
function selectedText(editor) {
    restoreRange(editor);
    if (ie) return getRange(editor).text;
    return getSelection(editor).toString();
  }
422064
public SelectStep text(String text) {
		return new SelectStep(element, text, SelectStep.OptionSelectorType.TEXT);
	}
345718
def selectedText(self):
        
        texts = []
        for editor in self.editors():
            text = editor.selectedText()
            if text:
                texts.append(nativestring(text))
        
        return ' '.join(texts)
187335
def pickTextColor(self):
        
        clr = QColorDialog.getColor(self.textColor(),
                                    self.window(),
                                    'Pick Text Color')
        
        if clr.isValid():
            self.setTextColor(clr)
368605
function selectedHTML(editor) {
    restoreRange(editor);
    var range = getRange(editor);
    if (ie)
      return range.htmlText;
    var layer = $("<layer>")[0];
    layer.appendChild(range.cloneContents());
    var html = layer.innerHTML;
    layer = null;
    return html;
  }
1106888
function selectText(element)
			{
				if(element)
				{
					var element = element[0];
					
					if (document.body.createTextRange)
					{
						var range = document.body.createTextRange();
						range.moveToElementText(element);
						range.select();
					}
					else if (window.getSelection)
					{
						var selection = window.getSelection();  
						var range = document.createRange();
						
						if(element != "undefined" && element != null)
						{
							range.selectNodeContents(element);
							
							selection.removeAllRanges();
							selection.addRange(range);
							
							if($(element).is(":empty"))
							{
								$(element).append("&nbsp;");
									selectText($(element));
							}
						}
					}
				}
			}
187694
public String getSelectedText( ParsedPage pp ){
		if( pp == null ) return null;
		
		StringBuilder sb = new StringBuilder();
		
		levelModifier = pp.getSection(0).getLevel()-1;
		
		if( pageHandling == null ){
			if( firstParagraphHandling != null ){				
				handleContent( pp.getFirstParagraph(), firstParagraphHandling, sb );
				deleteParagraph( pp.getFirstParagraphNr(), pp.getSections() );
			}
			for( Section s: pp.getSections() )
				handleSection( s, sb );
		}
		else{
			if( pageHandling.get( CIT.TEXT ) ){
				sb.append( pp.getText() );
			}
			else{
				if( pageHandling.get( CIT.BOLD )){
					handleSpans( pp.getFormatSpans( FormatType.BOLD ), pp.getText(), sb );
				}
				if( pageHandling.get( CIT.ITALIC )){
					handleSpans( pp.getFormatSpans( FormatType.ITALIC ), pp.getText(), sb );
				}
			}
			
			if( pageHandling.get( CIT.LINK ))
				handleLinks( pp.getLinks(), !pageHandling.get( CIT.TEXT ), sb );
		}
		
		return sb.toString().trim();
	}
220739
def select_current_cell(self):
        """"""
        cursor = self.textCursor()
        cursor.movePosition(QTextCursor.StartOfBlock)
        cur_pos = prev_pos = cursor.position()

        # Moving to the next line that is not a separator, if we are
        # exactly at one of them
        while self.is_cell_separator(cursor):
            cursor.movePosition(QTextCursor.NextBlock)
            prev_pos = cur_pos
            cur_pos = cursor.position()
            if cur_pos == prev_pos:
                return cursor, False
        prev_pos = cur_pos
        # If not, move backwards to find the previous separator
        while not self.is_cell_separator(cursor):
            cursor.movePosition(QTextCursor.PreviousBlock)
            prev_pos = cur_pos
            cur_pos = cursor.position()
            if cur_pos == prev_pos:
                if self.is_cell_separator(cursor):
                    return cursor, False
                else:
                    break
        cursor.setPosition(prev_pos)
        cell_at_file_start = cursor.atStart()
        # Once we find it (or reach the beginning of the file)
        # move to the next separator (or the end of the file)
        # so we can grab the cell contents
        while not self.is_cell_separator(cursor):
            cursor.movePosition(QTextCursor.NextBlock,
                                QTextCursor.KeepAnchor)
            cur_pos = cursor.position()
            if cur_pos == prev_pos:
                cursor.movePosition(QTextCursor.EndOfBlock,
                                    QTextCursor.KeepAnchor)
                break
            prev_pos = cur_pos
        cell_at_file_end = cursor.atEnd()
        return cursor, cell_at_file_start and cell_at_file_end
831428
function _get_selected(){
    	var ret_list = [];
	var selected_strings =
	    jQuery('#'+ sul_id).sortable('toArray', {'attribute': 'value'});
    	each(selected_strings,
    	     function(in_thing){
		 if( in_thing && in_thing != '' ){
		     ret_list.push(in_thing);
		 }
	     });
	return ret_list;
    }
128082
private static String getTextContent(final Element element) {
		if (element != null) {
			String content = element.getTextContent();
			if (content != null) {
				content = content.trim();
			}
			return content;
		}
		return null;
	}
877356
public String selectedOption() {
        if (isNotPresentSelect()) {
            return null;
        }
        WebElement webElement = element.getWebElement();
        Select dropdown = new Select(webElement);
        WebElement option = dropdown.getFirstSelectedOption();
        return option.getText();
    }
1071147
def currentText( self ):
        
        text = nativestring(self.text())
        if text or not self.useHintValue():
            return text
        return self.hint()
195634
function text(text) {
  if (typeof text === 'undefined') {
    if (this[0]) {
      return this[0].textContent.trim();
    }
    return null;
  }

  for (let i = 0; i < this.length; i += 1) {
    this[i].textContent = text;
  }
  return this;
}
622257
protected boolean checkTextSelectedInList(PageElement pageElement, String text) throws FailureException {
        try {
            final WebElement select = Context.waitUntil(ExpectedConditions.elementToBeClickable(Utilities.getLocator(pageElement)));
            final Select dropDown = new Select(select);
            return text.equalsIgnoreCase(dropDown.getFirstSelectedOption().getText());
        } catch (final Exception e) {
            new Result.Failure<>(text, Messages.getMessage(Messages.FAIL_MESSAGE_UNABLE_TO_FIND_ELEMENT), true, pageElement.getPage().getCallBack());
            return false;
        }
    }
996285
def blank?(str)
      str.nil? or (str.is_a? String and str.strip.empty?)
    end
17127
private static String getText(Element element) {
    if (element.getFirstChild() == null) {
      return "";
    }
    return ((Text) element.getFirstChild()).getData().trim();
  }
1233349
function selectAllText(change: Change): Change {
    const { value } = change;
    const { startBlock } = value;

    return change.moveOffsetsTo(0).extend(startBlock.text.length);
}