Interviewer And Interviewee Guide

SilkTest Interview Question:

How to sort List of List of String?

Submitted by: Administrator
[+] testcase test() appstate none
[ ]
[ ] LIST OF LIST OF STRING llsStr =
{{"1234","A"},{"2242","B"},{"2234","C"}}
[ ] Print(Sort(llsStr))
[+] LIST OF LIST OF STRING Sort (LIST OF LIST OF STRING llsStr)
[ ]
[ ] LIST OF STRING lsStr
[ ] INTEGER i, j , k
[ ] k = ListCount(llsStr)
[+] for (i=1;i <= k;i++)
[+] for (j=i+1; j<=k; j++)
[+] if val(llsStr[i][1]) > val (llsStr[j][1])
[ ] lsStr = llsStr[j]
[ ] llsStr[j] = llsStr[i]
[ ] llsStr[i] = lsStr
[ ]
[ ]
[ ] return llsStr
Submitted by: Administrator

Read Online SilkTest Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.